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

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

141. 网络和格式-GET [ 96%]

...aya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.connect(); this.showLogger(); } connect() { const HttpRequest = Laya.HttpRequest, Event = Laya.Event; hr = new HttpRequest(); hr.once(Event.PROGRESS, this, this.onHttpRequestProgress); hr.once(Event.COMPLETE, this, this....

来源: Laya2.0_示例 发布时间: 20251209

142. 区块地图-等角地图 [ 96%]

...aya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.createMap(); Laya.stage.on(Laya.Event.CLICK, this, this.onStageClick); } createMap() { const TiledMap = Laya.TiledMap, Rectangle = Laya.Rectangle, Point = Laya.Point; this.tiledMap = new TiledMap(); this.tiledMap.createM...

来源: Laya2.0_示例 发布时间: 20251209

143. 那个文本溢出需要滚动条怎么弄,API里面就说用Scroll接口,小白 不懂怎么弄 [ 96%]

...来自: Laya.init(500,400,Laya.WebGL);createText();function createText(){this.txt = new Laya.Text();this.txt.overflow = Laya.Text.SCROLL;this.txt.text = "Layabox是HTML5引擎技术提供商与优秀的游戏发行商,面向AS/JS/TS开发者提供HTML5开发技术方案!\n" ;this.txt.size(200,10...

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

144. 舞台的位置怎么自由设定 [ 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

145. 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

146. 鼠标交互-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_示例 发布时间: 20251209

147. 缓动-时间线 [ 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_示例 发布时间: 20251209

148. 输入设备-地图 [ 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_示例 发布时间: 20251209

149. 在线急等,发现你们这个编译器一个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

150. 动画实例在调用含有名字参数的时候获取不到边界 [ 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