大约有 13 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0097 秒)
...用预设 ``` 下面采用伪代码: 先声明一个预设变量 {Laya.loader.create("prefab/预设名字.json",Handler.create(this,onComplete)); } private function onComplete(obj:Object):Void{ 一个预设变量.json = ojb 一个sprite = Pool.getItemByCreateFun("自己起一个名字", this.一...
来源: Laya2.0_文档 发布时间: 20210714
...载纹理资源,如果要使用纹理压缩格式,则需要使用`Laya.loader.load()`来加载纹理资源。 示例代码如下所示: ```typescript //检测安卓平台 if (Laya.Browser.onAndroid) { //注意这里的加载 Laya.loader.load("res/layabox.ktx", Laya.Handler.create(null, functio...
来源: Laya2.0_文档 发布时间: 20210714
...下: ```typescript //先加载plf类型的合并后文件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:T...
来源: Laya2.0_文档 发布时间: 20210714
...的示例代码为: ```javascript //atlas方式图集使用示例 Laya.loader.load("./res/test/c1.atlas", Laya.Handler.create(this, onLoaded)); ``` `.json`是一种兼容第三方的图集配置方式,由于`.json`文件应用广泛,不仅仅用于图集,所以为了识别是否为图...
来源: Laya2.0_文档 发布时间: 20210715
...的示例代码为: ```typescript //atlas方式图集使用示例 Laya.loader.load("./res/atlas/test.atlas", Laya.Handler.create(this, this.onLoaded)); ``` `.json`是一种兼容第三方的图集配置方式,由于`.json`文件应用广泛,不仅仅用于图集,所以为了识别是否为...
来源: Laya2.0_文档 发布时间: 20210714
...的示例代码为: ```typescript //atlas方式图集使用示例 Laya.loader.load("./res/atlas/test.atlas", Handler.create(this, onLoaded)); ``` `.json`是一种兼容第三方的图集配置方式,由于`.json`文件应用广泛,不仅仅用于图集,所以为了识别是否为图集配置...
来源: Laya2.0_文档 发布时间: 20210714
...认应用程序。编写代码如下: ```java package { import laya.net.Loader; import laya.utils.Handler; import ui.EffectAnimationDemoUI; public class Main { public function Main() { //初始化舞台 Laya.init(1334,750); //设置舞台背景色 Laya.stage.bgColor = "#ffffff" //加载图集资...
来源: Laya2.0_文档 发布时间: 20210715
...; //加载图集资源,加载成功后将UI界面添加到舞台上 Laya.loader.load("./res/atlas/comp.atlas",Laya.Handler.create(this,onLoaded)); function onLoaded(){ //实例化导出的UI类 var efc = new ui.TestPUI(); //添加到舞台 Laya.stage.addChild(efc); } ``` 运行后,按钮被按...
来源: Laya2.0_文档 发布时间: 20210715
...; //加载图集资源,加载成功后将UI界面添加到舞台上 Laya.loader.load("./res/atlas/ui.atlas",Laya.Handler.create(this,this.onLoaded)); } private onLoaded():void{ //实例化导出的UI类 var efc:ui.EffectAnimationDemoUI = new ui.EffectAnimationDemoUI(); //添加到舞台 Laya.stage...
来源: Laya2.0_文档 发布时间: 20210715
... ```javascript //加载图集成功后,执行onLoaded回调方法 Laya.loader.load("res/atlas/ui.atlas", Laya.Handler.create(this, onLoaded)); ``` 第二步:创建Animation实例,加载动画文件 ```javascript //创建一个Animation实例 var tl = new Laya.Animation(); //加载动画文件 ...
来源: Laya2.0_文档 发布时间: 20210715