大约有 56 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0060 秒)
...的示例代码为: ```typescript //atlas方式图集使用示例 Laya.loader.load("./res/atlas/test.atlas", Handler.create(this, onLoaded)); ``` `.json`是一种兼容第三方的图集配置方式,由于`.json`文件应用广泛,不仅仅用于图集,所以为了识别是否为图集配置...
来源: 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
...e(); // 守护神 this.angel = new Sprite(); // 加载主体的背景 Laya.loader.load("res/island.png", Handler.create(this, function() { // 图片加载 var t = Laya.loader.getRes("res/island.png"); var tBall = Texture.create(t,866,190,548,305); var tTower = Texture.create(t,data.tower[towerLel].x...
来源: Laya_社区 发布时间: 20170720
... 0 0 分享 微博 QZONE 微信 Recovery 赞同来自: 微信小游戏Laya.loader.loadPackage 与 Laya.URL.basePath的互斥问题 - layabox问答社区-HTML5引擎社区-LayaAir开发者社区 试试这个 2025-09-26 0 0 分享 微博 QZONE 微信 Fany 赞同来自: 感谢@Recovery 帮助 目前...
来源: Laya_社区 发布时间: 20250925
...添加到舞台 Laya.stage.addChild(this.bg); // 加载图集资源 Laya.loader.load("res/atlas/war.json",Laya.Handler.create(this,onLoaded),null,Laya.Loader.ATLAS); })(); function onLoaded(){ // 创建一个主角 this.hero = new Role(); // 初始化角色 this.hero.init("hero",0,1,0,30); // 设置...
来源: Laya_社区 发布时间: 20170525
...undMuted)return null; }; var tSound; if (!Browser.onMiniGame){ tSound=Laya.loader.getRes(url); } if (!soundClass)soundClass=SoundManager._soundClass; if (!tSound){ tSound=new soundClass(); tSound.load(url); Loader.cacheRes(url,tSound); }; var channel; channel=tSound.play(startTime,loops); if (!chann...
来源: Laya_社区 发布时间: 20180709
...添加到舞台 Laya.stage.addChild(this.bg); // 加载图集资源 Laya.loader.load("res/atlas/war.json",Laya.Handler.create(this,onLoaded),null,Laya.Loader.ATLAS); })(); function onLoaded(){ // 创建一个主角 this.hero = new Role(); // 初始化角色 this.hero.init("hero",0,1,0,30); // 设置...
来源: Laya_社区 发布时间: 20170525
... string): void { Laya.SoundManager.stopAll(); Laya.loader.clearRes(currentBgmUrl); Laya.loader.load([{ url: currentBgmUrl, type: Laya.Loader.SOUND }], Laya.Handler.create(this, () => { console.log("----playMusic111 ...
来源: Laya_社区 发布时间: 20250930
...内容并返回。如果不需要支持热重载,则忽略。 @Laya.regLoader(["abc"], null, true) export class DemoAssetLoader implements Laya.IResourceLoader { async load(task: Laya.ILoadTask): Promise<any> { let json = await task.loader.fetch(task.url, "json"); let res = task.obsoluteInst...
来源: Laya3.0_文档 发布时间: 20251010
... Texture; set texture(value: Texture); 我们来看看代码示例: Laya.loader.load("atlas/comp/image.png").then(() => { let sprite = new Laya.Sprite(); //精灵设置纹理并居中显示 let res = Laya.loader.getRes("atlas/comp/image.png"); sprite.pos(Laya.stage.width >> 1, Laya.stage....
来源: Laya3.0_文档 发布时间: 20251010