• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 250 项符合查询结果, 库内数据总量为 31,580 项。 (搜索耗时: 0.0063 秒)

211. CPU优化方式(JavaScript-2D进阶篇(JS)-性能优化) [ 49%]

...正确获取宽高。 1. **直接调用size设置:** ```javascript Laya.loader.load("res/apes/monkey2.png",Handler.create(this,function() { var texture=Laya.loader.getRes("res/apes/monkey2.png"); var sp=new Laya.Sprite(); sp.graphics.drawTexture(texture,0,0); sp.size(texture.width,texture.height);...

来源: Laya2.0_文档 发布时间: 20210715

212. 1.70beta Dialog增加动画后第二次执行popup显示弹窗 [ 49%]

...; assets = ["../../res/ui/dialog (1).png", "../../res/ui/close.png"]; Laya.loader.load(assets, Handler.create(this, onSkinLoadComplete)); })(); function onSkinLoadComplete() { var dialog = new Dialog(); var bg = new Image(assets[0]); dialog.addChild(bg); var button = new Button(assets[1]); button.na...

来源: Laya_社区 发布时间: 20170303

213. CPU优化方式(TypeScript-2D进阶篇(TS)-性能优化) [ 48%]

...正确获取宽高。 1. **直接调用size设置:** ```typescript Laya.loader.load("res/apes/monkey2.png",Laya.Handler.create(this,function() { var texture=Laya.loader.getRes("res/apes/monkey2.png"); var sp=new Laya.Sprite(); sp.graphics.drawTexture(texture,0,0); sp.size(texture.width,texture.hei...

来源: Laya2.0_文档 发布时间: 20210714

214. 1.7.19.1 beta 背景音乐在舞台失焦和静音状态下可能导致的无法播放的异常问题! [ 47%]

...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

215. videoNode在安卓上能播放 [ 47%]

...   Laya.stage.on(Laya.Event.MOUSE_DOWN, () => {             Laya.loader.load("resources/916.mp4").then(() => {                 this.play();             });         })     }同时建议您将“项目设置->缩放模式”更改为fixedwidth,便于手机调试...

来源: Laya_社区 发布时间: 20231007

216. Button属性详解(JavaScript-IDE篇(JS)-IDE组件属性详解) [ 45%]

...g/btn_test.png"; //加载资源成功后,执行onLoaded回调方法 Laya.loader.load(skin,Laya.Handler.create(this,onLoaded)); function onLoaded(){ //创建一个Button实例 var btn = new Laya.Button(skin); //将Button添加到舞台上 Laya.stage.addChild(btn); //设置Button相关属性 btn.wid...

来源: Laya2.0_文档 发布时间: 20210714

217. 2D性能优化 · LayaAir3.3 · 引擎文档 · LAYABOX [ 45%]

...ources/apes/monkey2.png"); assets.push("resources/apes/monkey3.png"); Laya.loader.load(assets).then(()=>{ for(var i:number = 0, len: number = assets.length; i<len; ++i) { var asset:string = assets[i]; //查看log,清理前资源一直在内存中 console.log(Laya.loader.getRes(asset)); //调...

来源: Laya3.0_文档 发布时间: 20251010

218. Button属性详解(TypeScript-IDE篇(TS)-IDE组件属性详解) [ 45%]

...lor = "#ffffff"; //加载资源成功后,执行onLoaded回调方法 Laya.loader.load(this.skin,Laya.Handler.create(this,this.onLoaded)); } private onLoaded():void{ //创建一个Button实例 var btn:Laya.Button = new Laya.Button(this.skin); //将Button添加到舞台上 Laya.stage.addChild(btn); /...

来源: Laya2.0_文档 发布时间: 20210714

219. Button属性详解(ActionScript-IDE篇(AS3)-IDE组件属性详解) [ 44%]

...lor = "#ffffff"; //加载资源成功后,执行onLoaded回调方法 Laya.loader.load(skin, Handler.create(this, onLoaded)); } private function onLoaded():void { //创建一个Button实例 var btn:Button = new Button(skin); //将Button添加到舞台 Laya.stage.addChild(btn); //设置Button相关...

来源: Laya2.0_文档 发布时间: 20210715

220. CheckBox属性详解(JavaScript-IDE篇(JS)-IDE组件属性详解) [ 42%]

... = "checkbox.png"; //加载资源成功后,执行onLoad回调方法 Laya.loader.load([skin1,skin2],Laya.Handler.create(this,onLoaded)); function onLoaded(){ //创建一个CheckBox实例cb1 var cb1 = new Laya.CheckBox(this.skin1); //添加到舞台上显示 Laya.stage.addChild(cb1); //设置checkbo...

来源: Laya2.0_文档 发布时间: 20210715