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

大约有 3,974 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0081 秒)

601. 手机QQ厘米秀GLTF模型使用说明(TypeScript-小游戏适配文档-QQ小游戏) [ 87%]

...装扮配置文件, 与装扮图片资源, 用于还原脸部装扮 */ var struct: CmShowCharacterStruct = new CmShowCharacterStruct(); // gltf 模型资源对象 struct.gltfURL = {}; for (const key in this.gltfFile) { struct.gltfURL[key] = this.gltfFile[key]; } // 个性化配置对象 / 可省...

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

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

...,可以使用局部变量来保存它: ```javascript function foo() { var prop = target.prop; // 使用prop process1(prop); process2(prop); process3(prop); } ``` ### 二、计时器 LayaAir提供两种计时器循环来执行代码块。 1. `Laya.timer.frameLoop`执行频率依赖于帧频率,...

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

603. Tree属性详解(TypeScript-IDE篇(TS)-IDE组件属性详解) [ 87%]

... (图) ####5. 调整 Tree 的宽高。 ​ 设置 Tree 对象的属性 var(全局引用名)的值为 m_tree ,此处名字可以自定义,目的是在脚本中对此 Tree 组件对象赋值。 ​ ![图片0.png](img/12.png) ​ (图) ####6. 在代码里给 Tree 对象赋值 ```javascr...

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

604. Sprite-切换纹理 [ 87%]

...e.on("click", this, this.switchTexture); } private switchTexture(): void { var textureUrl: string = (this.flag = !this.flag) ? this.texture1 : this.texture2; // 更换纹理 this.ape.graphics.clear(); var texture: Texture = Laya.loader.getRes(textureUrl); this.ape.graphics.drawTexture(texture, 0, 0)...

来源: Laya2.0_示例 发布时间: 20240930

605. 多点触控的使用(ActionScript-3D基础(AS3)-LayaAir3D之鼠标交互) [ 87%]

...写脚本中的onUpdate方法 override public function onUpdate():void { var touchCount:int = _scene.input.touchCount(); if (1 === touchCount){ //判断是否为两指触控,撤去一根手指后引发的touchCount===1 if (isTwoTouch){ return; } _text.text = "触控点为1"; //获取当前的触...

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

606. 多摄像机窗口的使用(ActionScript-3D基础(AS3)-LayaAir3D之Camera) [ 87%]

...ort进行左右视口分离,代码如下: ```typescript //创建场景 var scene:Scene3D = Laya.stage.addChild(new Scene3D()) as Scene3D; //创建相机1 var camera1:Camera = scene.addChild(new Camera(0, 0.1, 100)) as Camera; //设置相机1清除颜色 camera1.clearColor = new Vector4(0.3, 0.3,...

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

607. 绘制圆形与扇形(JavaScript-LayaAir基础篇(JS)-矢量图) [ 87%]

...一个圆形,示例代码如下: ```javascript (function() {     var Sprite = Laya.Sprite;     var Stage  = Laya.Stage;        (function()     {         //初始化舞台         Laya.init(500, 300);         drawSomething();     })();     ...

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

608. 关于多个小动画打包到一个图集动画的问题 [ 87%]

...reate(this,onLoaded),null,Laya.Loader.ATLAS) //先把四张小图拿出来 var hero_down1=Laya.loader.getRes("hero/hero_down1.jpg"); var hero_down2=Laya.loader.getRes("hero/hero_down2.jpg"); var hero_down3=Laya.loader.getRes("hero/hero_down3.jpg"); var hero_down4=Laya.l...

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

609. 关于graphics镂空的问题https://ask.layabox.com/question/139 [ 87%]

...on-out实现flash中两次draw镂空可点击穿透完全一致的效果。var redBox:Sprite = new Sprite(); redBox.pos(250,200); redBox.autoSize = true; redBox.graphics.drawRect(0,0,100,100,'#ff0000'); Laya.stage.addChild(redBox); redBox.on("click",this,function(){ trace("click redbox"); }); redBox...

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

610. 加载-加载序列 [ 87%]

...三种开发语言、LayaAirIDE让项目开发更高效。(function() { var Texture = Laya.Texture; var Handler = Laya.Handler; var numLoaded = 0; var resAmount = 3; (function() { Laya.init(500, 400); // 按序列加载 monkey2.png - monkey1.png - monkey0.png // 不开启缓存 // 关闭并发加...

来源: Laya_示例 发布时间: 20240930