大约有 3,979 项符合查询结果, 库内数据总量为 30,903 项。 (搜索耗时: 0.0079 秒)
Laya_社区(2827) Laya2.0_文档(369) Laya2.0_api(225) laya_api(169) Laya_示例(157) Laya2.0_示例(117) Laya3.0_api(62) Laya3.0_文档(53)
...装扮配置文件, 与装扮图片资源, 用于还原脸部装扮 */ var struct: CmShowCharacterStruct = new CmShowCharacterStruct(); // gltf 模型资源对象 struct.gltfURL = {}; for (const key in this.gltfFile) { struct.gltfURL[key] = this.gltfFile[key]; } // 个性化配置对象 / 可省...
来源: Laya2.0_文档 发布时间: 20210715
...,可以使用局部变量来保存它: ```javascript function foo() { var prop = target.prop; // 使用prop process1(prop); process2(prop); process3(prop); } ``` ### 二、计时器 LayaAir提供两种计时器循环来执行代码块。 1. `Laya.timer.frameLoop`执行频率依赖于帧频率,...
来源: Laya2.0_文档 发布时间: 20210715
... (图) ####5. 调整 Tree 的宽高。 设置 Tree 对象的属性 var(全局引用名)的值为 m_tree ,此处名字可以自定义,目的是在脚本中对此 Tree 组件对象赋值。  (图) ####6. 在代码里给 Tree 对象赋值 ```javascr...
来源: Laya2.0_文档 发布时间: 20210714
...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_示例 发布时间: 20250224
...写脚本中的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
...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
...一个圆形,示例代码如下: ```javascript (function() { var Sprite = Laya.Sprite; var Stage = Laya.Stage; (function() { //初始化舞台 Laya.init(500, 300); drawSomething(); })(); ...
来源: Laya2.0_文档 发布时间: 20210715
...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
...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
...三种开发语言、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_示例 发布时间: 20250224