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

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

891. 读取大块材质中的图片并图片切割 [ 54%]

...置他们的Index索引值就可以获取到里面切好的图片。   private function updateScore():void{    var data:Object =  {};    var temp:Number =  this.score;    for (var i:int = 5; i > 0; i-- ){     data["item" i] = {index:Math.floor(temp)};     temp = temp/10;   ...

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

892. [LayaNative3]2d示例程序构建发布打包后,在OpenHarmony运行闪退 [ 54%]

...dle size 10479616, width 1080, height 2408, stride 4352, fd 8, format: <private>, phy 0x0, usage 0xb, viraddr 0x0000000000000000 01-06 17:34:41.531 902 1210 I C01401/Bufferqueue: <163>Alloc: buffer handle size 10479616, width 1080, height 2408, stride 4352, fd 106, transform 0 01-06 17:3...

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

893. 关于list滚动位置的问题 [ 54%]

...:"No."+m}); } mDemoUi.m_list.array=data; Laya.stage.addChild(mDemoUi); ... private function onChange():void{ trace("list index= "+mDemoUi.m_list.scrollBar.value); mDemoUi.valueLab.text="滚动条位置value= "+mDemoUi.m_list.scrollBar.value; }  如上所示,给list组件创建了21个item,但是val...

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

894. Laya场景编辑时加入的Graphics组件,代码中该如何获取? [ 54%]

...果是个Button的话,可以通过类似的代码来声明、获取: private backBtn: Laya.Button; this.backBtn = this.scene.getChildByName('backBtn') as Laya.Button;但这个Rect就不知道是什么类型的了,试了下Laya.Rect/Laya.Graphics.Rect之类的,都没有这个类。     附...

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

895. 关于嵌入div [ 54%]

...tage.bgColor = "#232628"; Laya.timer.once(500,this,onLoop); Stat.show(); } private function onLoop():void { __JS__('var LayaCanvas1=document.getElementsByTagName("canvas")[0]'); __JS__('var LayaCanvas2=document.getElementsByTagName("canvas")[1]'); __JS__('var LayaContainer=document.getElementById("l...

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

896. 怎么实现一个Timer的loop的delay时间越来越短? [ 54%]

..."#FF0000"); Laya.stage.addChild(sp); Laya.timer.loop(delay,this,onLoop); } private function onLoop():void { delay-=50; sp.x+=20; Laya.timer.clear(this,onLoop); Laya.timer.loop(delay,this,onLoop); } 2017-06-26 0 0 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 要回复问题请...

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

897. 鼠标脚本(ActionScript-3D基础(AS3)-LayaAir3D之鼠标交互) [ 54%]

...。 > **脚本类**: ```typescript class MouseScript extends Script3D{ private var meshsp:MeshSprite3D; public function MouseScript() {} /** * 覆写3D对象组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ override public function onAwake():voi...

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

898. 3d模型资源,加载后AddChild会报错,请教一下什么原因。 [ 54%]

...rt/LayaScene_role/role.lh", Handler.create(_instance, OnCreateComplete1)); private static function OnCreateComplete1():void{ trace("complete load role"); var sprite3D:Sprite3D = Laya.loader.getRes("laya_assert/LayaScene_role/role.lh"); mainScene.addChild(sprite3D); } 上面是我加载的代码。ma...

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

899. 批量销毁释放内存(JavaScript-3D基础(JS)-LayaAir3D的内存管理) [ 54%]

...空表示场景已加载完成 this.garbageCollection(); break; } /** * @private 销毁场景并且释放资源 */ garbageCollection() { this._scene.destroy();//销毁场景 this._scene = null; Laya.Resource.destroyUnusedResources();//销毁无用资源(没有被场景树引用,并且没有加资源...

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

900. 设置pivot后,精灵位置显示位置不正确 [ 54%]

...ite的pivot和pos,结果位置不正确 // 程序入口 class GameMain { private sp: Laya.Sprite; constructor() { Laya.init(2000, 1500); //设置舞台背景色 Laya.stage.bgColor = "#ffffff" this.sp = new Laya.Sprite(); let width = 660 let height = 420 this.sp.size(width, height) this.sp.pivot(Ma...

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