大约有 13 项符合查询结果, 库内数据总量为 30,778 项。 (搜索耗时: 0.0021 秒)
...r.create(this, this.onAssetLoaded), null, null, 2, false); } onAssetLoaded(texture) { console.log(texture.url); // 恢复默认并发加载个数。 if (++numLoaded == 3) { Laya.loader.maxLoader = 5; console.log("All done."); } } } new Loader_Sequence();module laya { import Texture = Laya.Texture; i...
来源: Laya2.0_示例 发布时间: 20241117
...onkey2.png"], Handler.create(this, this.onAssetLoaded2)); } onAssetLoaded1(texture) { // 使用texture } onAssetLoaded2() { const Loader = Laya.Loader; let pic1 = Loader.getRes("res/apes/monkey0.png"); let pic2 = Loader.getRes("res/apes/monkey1.png"); let pic3 = Loader.getRes("res/apes/monkey2.png")...
来源: Laya2.0_示例 发布时间: 20241117
...a.Handler; var ROBOT_DATA_PATH = "res/skeleton/robot/robot.bin"; var ROBOT_TEXTURE_PATH = "res/skeleton/robot/texture.png"; (function() { Laya.init(100, 100); var assets = []; assets.push( { url: ROBOT_DATA_PATH, type: Loader.BUFFER }); assets.push( { url: ROBOT_TEXTURE_PATH, type: Loader.IMAGE }); ...
来源: Laya2.0_示例 发布时间: 20241117
...载失败 Laya.loader.on(Event.ERROR, this, this.onError); } onAssetLoaded(texture) { // 使用texture console.log("加载结束"); } // 加载进度侦听器 onLoading(progress) { console.log("加载进度: " + progress); } onError(err) { console.log("加载失败: " + err); } } new Loader_Progress...
来源: Laya2.0_示例 发布时间: 20241117
...= Laya.Sprite; this.ape = new Sprite(); Laya.stage.addChild(this.ape); let texture = Laya.loader.getRes(apePath); this.ape.graphics.drawTexture(texture); this.ape.x = (Laya.stage.width - texture.width) / 2; this.ape.y = (Laya.stage.height - texture.height) / 2; } applayFilter() { // 创建一个发...
来源: Laya2.0_示例 发布时间: 20241117
...y2Str = "res/apes/monkey2.png", monkey1Res, monkey2Res; class Sprite_SwitchTexture { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.alignV = Stage....
来源: Laya2.0_示例 发布时间: 20241117
... Sprite(); this.ape.loadImage(ApePath); Laya.stage.addChild(this.ape); let texture = Laya.loader.getRes(ApePath); this.ape.pivot(texture.width / 2, texture.height / 2); this.ape.x = Laya.stage.width / 2; this.ape.y = Laya.stage.height / 2; this.ape.on(Event.MOUSE_DOWN, this, this.onStartDrag); } sho...
来源: Laya2.0_示例 发布时间: 20241117
...nt = Laya.Event; this.ape = new Sprite(); this.ape.loadImage(apePath); let texture = Laya.loader.getRes(apePath); this.ape.pivot(texture.width / 2, texture.height / 2); this.ape.pos(Laya.stage.width / 2, Laya.stage.height / 2); this.ape.scale(0.8, 0.8); Laya.stage.addChild(this.ape); // 鼠标交互...
来源: Laya2.0_示例 发布时间: 20241117
...ya.stage.addChild(ape); ape.loadImage(monkey1Path); // 方法2:使用drawTexture Laya.loader.load(monkey2Path, Laya.Handler.create(this, function () { let monkey2 = Laya.loader.getRes(monkey2Path); let ape2 = new Laya.Sprite(); Laya.stage.addChild(ape2); ape2.graphics.drawTexture(monkey2, 100, 0);...
来源: Laya2.0_示例 发布时间: 20241117
...= Laya.Sprite; this.ape = new Sprite(); Laya.stage.addChild(this.ape); let texture = Laya.loader.getRes(apePath); this.ape.graphics.drawTexture(texture); this.ape.x = (Laya.stage.width - texture.width) / 2; this.ape.y = (Laya.stage.height - texture.height) / 2; } applayFilter() { // 创建一个模...
来源: Laya2.0_示例 发布时间: 20241117