大约有 63 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0059 秒)
...如果设置为true,则点击空白区域可以穿透过去。” 2.Laya.Handler 我在处理技能的时候用了对象池,其中类有对handler的持有,再次使用时发现数据不对了,查找很久才发现handler调用了recover,被对象池再次生成的对象引用覆盖了如...
来源: Laya_社区 发布时间: 20161109
...is.tMap.createMap("resources/TiledMap/orthogonal.json", viewRect, new Laya.Handler(this, this.completeHandler)); } //添加地图到Scene2D下 private onLoaded(): void { this.tMap.mapSprite().removeSelf(); this.owner.addChild(this.tMap.mapSprite()); } //地图加载完成的回调 private completeHa...
来源: Laya3.0_文档 发布时间: 20251010
... //加载引擎需要的资源 Laya.loader.load("../atlas/comp.atlas",Laya.Handler.create(this,this.onLoaded)); } private onLoaded():void{ //实例UI界面 var testView:ui.test.TestPageUI = new ui.test.TestPageUI(); Laya.stage.addChild(testView); } } new LayaUISample; WorkerLoader.workerPath = "libs...
来源: Laya3.0_文档 发布时间: 20251010
...//加载引擎需要的资源 Laya.loader.load("res/atlas/comp.atlas",Laya.Handler.create(this,onLoaded)); function onLoaded(){ //实例UI界面 var testView = ui.test.TestPageUI(); Laya.stage.addChild(testView); } ``` `WorkerLoader.workerPath = "libs/worker.js";`设置worker.js的路径,这个wor...
来源: Laya2.0_文档 发布时间: 20210715
...//加载引擎需要的资源 Laya.loader.load("res/atlas/comp.atlas",Laya.Handler.create(this,this.onLoaded)); } private onLoaded():void{ //实例UI界面 var testView:ui.test.TestPageUI = new ui.test.TestPageUI(); Laya.stage.addChild(testView); } } new LayaUISample; ``` `WorkerLoader.workerPath = ...
来源: Laya2.0_文档 发布时间: 20210715
...x.com/"; this.qrcode.makeCode(url); Laya.stage.once("click",this,this.clickHandler); this.qrcodeSp = new Laya.Sprite(); Laya.stage.addChild(this.qrcodeSp); 编译运行上面的代码,然后点击舞台可以看到,二维码已经显示到了舞台上,可以用手机扫下,发现手机已经...
来源: Laya3.0_文档 发布时间: 20251010
...#787878,#d3d3d3,#FFFFFF"; rg.labelSize = 20; rg.labelBold = true; rg.selectHandler = new Laya.Handler(this, this.onSelectChange); this.owner.addChild(rg); return rg; } private onSelectChange(index: number): void { console.log("你选择了第 " + (index + 1) + " 项"); } } 效果如图所示: (...
来源: Laya3.0_文档 发布时间: 20251016
...文件Image.json Laya.loader.load([{url: "res/Image.json", type: "plf"}], Handler.create(this, function():void { //在回调里,正常使用原来的图集 Laya.loader.load("res/atlas/comp.atlas", Handler.create(this, function():void { var img:Texture = Laya.loader.getRes("comp/comp.png"); var sp:...
来源: Laya2.0_文档 发布时间: 20210714
... (function () { var Loader = Laya.Loader; var Browser = Laya.Browser; var Handler = Laya.Handler; console.log("!____________________________________") var ProtoBuf = Browser.window.protobuf; // Laya.init(550, 400); ProtoBuf.load("res/protobuf/Login.proto", onAssetsLoaded); function onAssetsL...
来源: Laya_社区 发布时间: 20180704
...* @return 返回精灵对象本身。 */ loadImage(url: string, complete?: Handler): Sprite; 我们来看看代码示例: let sprite = new Laya.Sprite(); // 加载并显示一个图片,居中显示 sprite.loadImage("atlas/comp/image.png", null); sprite.pos(Laya.stage.width >> 1, Laya.stage...
来源: Laya3.0_文档 发布时间: 20251010