大约有 99 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0040 秒)
...s/comp/hscroll.png"; panel.size(600, 275); panel.pos(150, 150); this.owner.addChild(panel); // 创建Image组件,作为Panel的子节点 let img: Laya.Image; for (var i: number = 0; i < 4; i++) { // 创建4个Image,水平排列 img = new Laya.Image("atlas/comp/image.png"); img.x = i * 512; pa...
来源: Laya3.0_文档 发布时间: 20251010
...`typescript //创建盒型MeshSprite3D var box: MeshSprite3D = (this.scene.addChild(new MeshSprite3D(PrimitiveMesh.createBox(1, 1, 1)))); //设置材质 var transform: Transform3D = box.transform; var pos: Vector3 = transform.position; pos.setValue(0, 5, 0); transform.position = pos; //创建刚体...
来源: Laya2.0_文档 发布时间: 20210715
...`typescript //创建盒型MeshSprite3D var box: MeshSprite3D = (this.scene.addChild(new MeshSprite3D(PrimitiveMesh.createBox(1, 1, 1)))); //设置材质 var transform: Transform3D = box.transform; var pos: Vector3 = transform.position; pos.setValue(0, 5, 0); transform.position = pos; //创建刚体...
来源: Laya2.0_文档 发布时间: 20210715
... Laya.Scene3D(); //将场景加到舞台上 this.scene = scene; Laya.stage.addChild(scene); //添加方向光 var directionlight: Laya.DirectionLight = scene.getChildByName( "Directional Light" ) as Laya.DirectionLight; this.directionlight = directionlight; //加入子層人物腳色到舞台 var li...
来源: Laya_社区 发布时间: 20200917
...Arial"; ti.fontSize = 30; ti.bold = true; ti.color = "#606368"; this.owner.addChild(ti); return ti; } } (代码中的图片资源来自“引擎API使用示例”项目,开发者可以自行创建下载) 运行结果: (图2-1) Copyright ©Layabox 2025 all right reserved,powered by Laya...
来源: Laya3.0_文档 发布时间: 20251010
...wScene = <Laya.Scene3D>Util3d.getRes(this.sMapRes, false) Laya.stage.addChild(pNewScene); Util3d.getChildByPath(pNewScene, "Main Camera").active = false; let pBull = <Laya.Sprite3D>Util3d.getRes(this.sBullRes) let pEnemy = <Laya.Sprite3D>Util3d.getRes(this.sEnemyRes) pNewScene.addC...
来源: Laya_社区 发布时间: 20200720
...gressBar.changeHandler = new Laya.Handler(this, this.onChange); this.owner.addChild(this.progressBar); Laya.timer.loop(100, this, this.changeValue); }); } // 模拟进度条加载 private changeValue(): void { if (this.progressBar.value >= 1) this.progressBar.value = 0; this.progressBar.value += ...
来源: Laya3.0_文档 发布时间: 20251010
...``typescript //创建盒型MeshSprite3D var box: MeshSprite3D = this.scene.addChild(new MeshSprite3D(PrimitiveMesh.createBox(1, 1, 1))) as MeshSprite3D; //设置材质 var transform: Transform3D = box.transform; var pos: Vector3 = transform.position; pos.setValue(0, 5, 0); transform.position = pos; ...
来源: Laya2.0_文档 发布时间: 20210714
...nAwake(): void { let opendata = new Laya.OpenDataContextView(); Laya.stage.addChild(opendata); opendata.pos(100,100); opendata.size(500,500); } } 成功创建开放数据域视图节点后,我们只是完成了引擎层面要完成的工作流程,接下来我们还要完成微信小游戏层面...
来源: Laya3.0_文档 发布时间: 20251010
...text.align = "center"; this.text.y = 20; this.text.centerX = 0; this.owner.addChild(this.text); } /** * 发起HTTP连接请求 */ private connect(): void { //创建HttpRequest对象 this.hr = new HttpRequest(); //请求响应的进度改变时触发 this.hr.on(Event.PROGRESS, this, this.onHttpReques...
来源: Laya3.0_文档 发布时间: 20251010