大约有 61 项符合查询结果, 库内数据总量为 30,903 项。 (搜索耗时: 0.0058 秒)
... //加载引擎需要的资源 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_文档 发布时间: 20250103
...//加载引擎需要的资源 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_文档 发布时间: 20240910
...#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_文档 发布时间: 20240910
...文件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
...播放动画 Tween.to(item, {y : -10, scaleX : 0.1, alpha : 0}, 300, null, Handler.create(this, this.itemTweenComplete, [item])); this.updateScore(); } } } } //人物如果踩到地板了 就把人物的坐标设置到地板上面 this.player.y = floor.y; //如果到地板上面的 就得重置跳...
来源: Laya_社区 发布时间: 20160803
...是否是鼠标事件。 EventDispatcher loadImage(url:String, complete:Handler = null):Sprite 加载并显示一个图片。相当于加载图片后,设置texture属性 注意:2.0改动:多次调用,只会显示一个图片(1.0会显示多个图片),x,y,width,height参数取消。 Spri...
来源: Laya2.0_api 发布时间: 20190513
...* @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_文档 发布时间: 20250103