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

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

1. 性能测试-骨骼 [ 100%]

...e: Loader.IMAGE }, { url: mAniPath, type: Loader.BUFFER }], Handler.create(this, this.onAssetsLoaded)); } onAssetsLoaded() { const Loader = Laya.Loader, Templet = Laya.Templet, Event = Laya.Event; let tTexture = Loader.getRes(mTexturePath); let arraybuffer = Loader.getRes(mAniPath); mFactory = new T...

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

2. 其他引擎的Demo-Example_04 [ 99%]

...leMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; Stat.show(); this.createText(); this.start(); } start() { const Sprite = Laya.Sprite; for (var i = 0; i w) { stars[i].x = stars[i].x - w; } else if (stars[i].x h) { stars[i].y = stars[i].y - h; } else if (stars[i].y = []; private w:number...

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

3. 屏幕适配-缩放-No Border [ 99%]

...ya.stage.scaleMode = Stage.SCALE_NOBORDER; Laya.stage.bgColor = "#232628"; this.createCantralRect(); } createCantralRect() { const Sprite = Laya.Sprite; this.rect = new Sprite(); this.rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(this.rect); this.updateRectPos(); } update...

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

4. 屏幕适配-缩放-No Scale [ 99%]

...aya.stage.scaleMode = Stage.SCALE_NOSCALE; Laya.stage.bgColor = "#232628"; this.createCantralRect(); } createCantralRect() { const Sprite = Laya.Sprite; this.rect = new Sprite(); this.rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(this.rect); this.updateRectPos(); } update...

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

5. 屏幕适配-缩放-Extract Fit [ 99%]

...ya.stage.scaleMode = Stage.SCALE_EXACTFIT; Laya.stage.bgColor = "#232628"; this.createCantralRect(); } createCantralRect() { const Sprite = Laya.Sprite; this.rect = new Sprite(); this.rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(this.rect); this.updateRectPos(); } update...

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

6. 屏幕适配-缩放-Show All [ 99%]

...aya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.createCantralRect(); } createCantralRect() { const Sprite = Laya.Sprite; this.rect = new Sprite(); this.rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(this.rect); this.updateRectPos(); } update...

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

7. 网络和格式-Socket [ 99%]

...aya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.connect(); } connect() { const Socket = Laya.Socket, Event = Laya.Event; socket = new Socket(); //socket.connect("echo.websocket.org", 80); socket.connectByUrl("ws://echo.websocket.org:80"); output = socket.output; socke...

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

8. Sprite-旋转缩放 [ 97%]

...aya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.showApe(); } showApe() { this.ape = new Laya.Sprite(); Laya.stage.addChild(this.ape); this.ape.loadImage("res/apes/monkey2.png"); this.ape.pivot(55, 72); // this.ape.pos( Laya.stage.width / 2, Laya.stage.height / 2); thi...

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

9. 加载-错误处理和进度 [ 96%]

...fighter.png", "res/legend/map.jpg"]; Laya.loader.load(urls, Handler.create(this, this.onAssetLoaded), Handler.create(this, this.onLoading, null, false), Loader.TEXT); // 侦听加载失败 Laya.loader.on(Event.ERROR, this, this.onError); } onAssetLoaded(texture) { // 使用texture console.log("加...

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

10. 区块地图-PerspectiveWall [ 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; this.tiledMap = new TiledMap(); this.tiledMap.createMap("res/tiledMap/per...

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