• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 4,000 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0079 秒)

141. 舞台的位置怎么自由设定 [ 96%]

...坐标就全乱了  以下是源码里对于舞台位置的实现: if (this._alignH==="left")this.offset.x=0;         else if (this._alignH==="right")this.offset.x=screenWidth-realWidth;         else this.offset.x=(screenWidth-realWidth)*0.5 / pixelRatio;         if (this....

来源: Laya_社区 发布时间: 20191127

142. WebSocket发送与接收数据(TypeScript-LayaAir基础篇(TS)-数据与通信) [ 96%]

...a.Byte; constructor() { //初始化引擎 Laya.init(600, 400, Laya.WebGL); this.byte = new Laya.Byte(); //这里我们采用小端 this.byte.endian = Laya.Byte.LITTLE_ENDIAN; this.socket = new Laya.Socket(); //这里我们采用小端 this.socket.endian = Laya.Byte.LITTLE_ENDIAN; //建立连接 this...

来源: Laya2.0_文档 发布时间: 20210714

143. 鼠标交互-Hold [ 96%]

...; Laya.stage.bgColor = "#232628"; Laya.loader.load(apePath, Handler.create(this, createApe)); })(); function createApe() { // 添加一只猩猩 ape = new Sprite(); ape.loadImage(apePath); var texture = Laya.loader.getRes(apePath); ape.pivot(texture.width / 2, texture.height / 2); ape.pos(Laya.stage...

来源: Laya_示例 发布时间: 20241001

144. 缓动-时间线 [ 96%]

...n setup() { createApe(); createTimerLine(); Laya.stage.on( Event.KEY_DOWN, this, this.keyDown); } function createApe() { target = new Sprite(); target.loadImage("../../res/apes/monkey2.png"); Laya.stage.addChild(target); target.pivot(55, 72); target.pos(100,100); } function createTimerLine() { timeL...

来源: Laya_示例 发布时间: 20241001

145. 输入设备-地图 [ 96%]

...createDom(); initMap(); createInfoText(); var successHandler = new Handler(this, updatePosition); var errorHandler = new Handler(this, onError); // 使用高精度位置 Geolocation.enableHighAccuracy = true; Geolocation.watchPosition(successHandler, errorHandler); // 绑定作用域 convertToBaiduC...

来源: Laya_示例 发布时间: 20241001

146. 在线急等,发现你们这个编译器一个bug,不能实现负负得正,昨天明明解决了,过了一会又不行了,怎么回事 [ 96%]

... l13273866189 赞同来自: // 下落 _proto_.moveDownBall = function(){ this.ball.x -= this.vx; this.ball.y += this.vy; console.log("111111"); this.vy *= 0.99; this.vy += 0.25; console.log("222222"); if (this.ball.y + this.vy >= this.img1 ||this.ball.y + this.vy <= 0) { this.vy = -this.vy; co...

来源: Laya_社区 发布时间: 20171108

147. 动画实例在调用含有名字参数的时候获取不到边界 [ 96%]

...e.ALIGN_CENTER; Laya.stage.alignV = Laya.Stage.ALIGN_MIDDLE; } onEnable(){ this.playerUnit = []; this.enemyUnit = []; this.playerUnit.push(new Laya.Animation()); this.enemyUnit.push(new Laya.Animation()); this.loadUnit(); } loadUnit(){ for(let i of this.playerUnit ){ i.loadAtlas("./character/m1...

来源: Laya_社区 发布时间: 20200910

148. bundle.js里为什么有些是_this,有些是this [ 96%]

bundle.js里为什么有些是_this,有些是this 编译后,自定义的this.mySprite对象,在bundle.js文件里会出现 _this.mySprite 和 this.mySprite 两种,后者报错 附件 : --> 2018-11-30 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: ...

来源: Laya_社区 发布时间: 20181130

149. Spine动画最后一帧无法正常显示 [ 96%]

...后发现在Skeleton::_update方法中的以下语句:var tGraphics; if (this._aniMode == 0) { tGraphics = this._templet.getGrahicsDataWithCache(this._aniClipIndex, this._clipIndex) || this._createGraphics(); if (tGraphics && this.graphics != tGraphics) { this.graphics = tGraphics; } }决...

来源: Laya_社区 发布时间: 20200109

150. 半透明的矩形鼠标穿透问题 [ 96%]

半透明的矩形鼠标穿透问题 //画矩形 this.addLabel = new Sprite(); this.addLabel.graphics.drawRect(0, 730, 1440, 170, "#000000"); this.addLabel.alpha = 0.6; this.addLabel.mousethrough = false; this.addLabel.mouseEnabled = true; sp.addChild(this.addLabel); 仍然能够点击下面的按...

来源: Laya_社区 发布时间: 20170726