大约有 143 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0064 秒)
Laya3.0_api(61) Laya3.0_文档(44) Laya_社区(16) Laya2.0_api(7) laya_api(6) Laya2.0_文档(5) Laya2.0_示例(2) Laya_示例(2)
...色值 let colorBuffer = new Float32Array(20 * 4); for (var i = 0; i < this._colorNums; i++) { let offset = i * 4; colorBuffer[offset] = Math.random(); colorBuffer[offset + 1] = Math.random(); colorBuffer[offset + 2] = Math.random(); colorBuffer[offset + 3] = 1; } //设置uniformbuffer this.batch...
来源: Laya3.0_文档 发布时间: 20251010
...* 此方法为虚方法,使用时重写覆盖即可 */ onAwake(): void { this.curpos = new Laya.Vector3(); } /** * 第一次执行update之前执行,只会执行一次 * 此方法为虚方法,使用时重写覆盖即可 */ onStart(): void { this.camera = this.owner as Laya.Camera; if (this.tar...
来源: Laya3.0_文档 发布时间: 20251010
...reTest/.laya/compile.js compile Debugger listening on port 48982. Warning: This is an experimental feature and could change at any time. laya_ide_time.require.single.gulp-util: 7.87ms gulp.js:8 laya_ide_time.require.single.pretty-hrtime: 2.2ms gulp.js:8 laya_ide_time.require.single.chalk: 10.4ms gul...
来源: Laya_社区 发布时间: 20200607
...lt; sprite.numChildren; i++) { let child = sprite.getChildAt(i) as Sprite; this.findCompents(lists, child, componentType); } } //组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 onAwake(): void { let sprite = this.owner as Laya.Sprite; //sprite.cach...
来源: Laya3.0_文档 发布时间: 20251010
...source/ui/vscroll$down.png", "resource/ui/vscroll$up.png"], Handler.create(this, onLoadComplete)); } private function onLoadComplete():void { var arr:Array = [];//创建一个数组,用于存贮列表的数据信息。 for (var i:int = 0; i < 20; i++) { arr.push({label: "item" + i}); } var list...
来源: Laya3.0_api 发布时间: 20231115
...景颜色。 Laya.loader.load("resource/ui/btn_close.png", Handler.create(this, onLoadComplete));//加载资源。 } private function onLoadComplete():void { dialog = new Dialog_Instance();//创建一个 Dialog_Instance 类的实例对象 dialog。 dialog.dragArea = "0,0,150,50";//设置 dialog 的...
来源: Laya3.0_api 发布时间: 20231115
...ite);//将此 sprite 对象添加到显示列表。 sprite.on(Event.CLICK, this, onClickSprite);//给 sprite 对象添加点击事件侦听。 shape = new Sprite();//创建一个 Sprite 类的实例对象 sprite 。 shape.graphics.drawRect(0, 0, 100, 100, "#ccff00", "#ff0000", 2);//绘制一个有...
来源: Laya3.0_api 发布时间: 20231115
...ny = null, lineWidth: number = 1, percent?: boolean): DrawRectCmd { return this.addCmd(DrawRectCmd.create(x, y, width, height, fillColor, lineColor, lineWidth, percent)); } 代码示例: let sp = new Laya.Sprite(); //画矩形 sp.graphics.drawRect(20, 20, 100, 50, "#ffff00", "#00ff00", 5, false); ...
来源: Laya3.0_文档 发布时间: 20251010
...; constructor() { super(); } //组件被启用后执行 onEnable(): void { this._level = Math.round(Math.random() * 5) + 1; this._text = this.owner.getChildByName("levelTxt") as Laya.Text; this._text.text = this._level + ""; } //每帧更新时执行 onUpdate(): void { //让持续盒子旋转 (this....
来源: Laya3.0_文档 发布时间: 20251010
...我们也可以通过代码来加载和指定天空盒 var skyRenderer = this.scene.skyRenderer; //加载相机天空盒材质 Laya.Material.load("sky2.lmat", Laya.Handler.create(null, function(mat: any) { //修改天空盒渲染器的天空盒材质 skyRenderer.material = mat; })); 2.3 IDE中创建...
来源: Laya3.0_文档 发布时间: 20251010