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

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

141. 鼠标交互-鼠标交互 [ 89%]

...stage.width - 200) / 2; rect.y = (Laya.stage.height - 200) / 2; Laya.stage.addChild(rect); //增加鼠标事件 rect.on(Event.MOUSE_DOWN, this, this.mouseHandler); rect.on(Event.MOUSE_UP, this, this.mouseHandler); rect.on(Event.CLICK, this, this.mouseHandler); rect.on(Event.RIGHT_MOUSE_DOWN, this, t...

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

142. 鼠标交互-鼠标交互 [ 89%]

...stage.width - 200) / 2; rect.y = (Laya.stage.height - 200) / 2; Laya.stage.addChild(rect); //增加鼠标事件 rect.on(Event.MOUSE_DOWN, this, mouseHandler); rect.on(Event.MOUSE_UP, this, mouseHandler); rect.on(Event.CLICK, this, mouseHandler); rect.on(Event.RIGHT_MOUSE_DOWN, this, mouseHandler); r...

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

143. texture2D的setPixel纹理rgba数据之后会随着窗口的缩放,渐变成黑色 [ 89%]

...eenMode = Laya.Stage.SCREEN_NONE; Laya.Stat.show(); var scene = Laya.stage.addChild(new Laya.Scene3D()) as Laya.Scene3D; var camera = scene.addChild(new Laya.Camera(0, 0.1, 0)) as Laya.Camera; camera.transform.translate(new Laya.Vector3(0, 2, 20)); camera.transform.rotate(new Laya.Vector3(-15, 0, 0)...

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

144. 封装类的时候 怎么在类中表示自身? [ 89%]

...te(); //背景图 // box.loadImage("../bin/background.png"); // Laya.stage.addChild(box); bg1.loadImage("../bin/background.png"); this.addChild(bg1); bg2.loadImage("../bin/background.png"); bg2.pos(0,-852); this.addChild(bg2); 用this.addchild老是出错 2016-09-26 添加评论 免费帖 --> 分享...

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

145. CPU优化方式(TypeScript-2D进阶篇(TS)-性能优化) [ 89%]

...00,"#FF0000"); var bounds:Laya.Rectangle=sp.getGraphicBounds(); Laya.stage.addChild(sp); ``` getBounds可以满足多数多数需求,但由于其需要计算边界,不适合频繁调用。 1. 设置容器的autoSize为true。 ```typescript var sp=new Laya.Sprite(); sp.autoSize=true; sp.graphics....

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

146. 2D物理-仿生机器人 [ 89%]

...istener(); } Construct() { let ground = new Laya.Sprite(); Laya.Laya.stage.addChild(ground); let rigidbody = new Laya.RigidBody(); rigidbody.type = "static"; ground.addComponentIntance(rigidbody); let chainCollider = ground.addComponent(Laya.ChainCollider); chainCollider.points = "50,200,50,570,1050...

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

147. (实现手指控制模型的缩放旋转)触控可以识别 但是导入的模型没有根据触控反应 [ 89%]

...e)); } onComplete(){ //创建场景         var scene = Laya.stage.addChild(new Laya.Scene3D());         //创建相机         var camera = new Laya.Camera(0, 0.1, 100);         scene.addChild(camera);         //设置相机的名称         camera.na...

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

148. 位图切片组件 · LayaAir3.3 · 引擎文档 · LAYABOX [ 89%]

...bg.width >> 1, Laya.stage.height - bg.height >> 1); this.owner.addChild(bg); } private createTimerAnimation(): void { this.counter = new Laya.Clip(this.clipSkin, 10, 1); this.counter.autoPlay = true; this.counter.interval = 1000; this.counter.x = (Laya.stage.width - this.counter.width) /...

来源: Laya3.0_文档 发布时间: 20251010

149. 鼠标交互-滑动 [ 89%]

... / 2; this.button.on(Event.MOUSE_DOWN, this, this.onMouseDown); Laya.stage.addChild(this.button); //左侧临界点设为圆形初始位置 beginPosition = this.button.x; //右侧临界点设置 endPosition = beginPosition + TrackLength; } drawTrack() { Laya.stage.graphics.drawLine( beginPosition, L...

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

150. 多重遮罩显示异常 [ 89%]

...bg = new Laya.Sprite(); bg.graphics.drawRect(0, 0, 500, 500, '#aaa'); this.addChild(bg); this.panel = new Laya.Panel(); this.panel.width = 500; this.panel.height = 500; this.panel.vScrollBarSkin = ''; this.panel.hScrollBarSkin = ''; this.addChild(this.panel); let line = new Laya.Sprite(); line.size(...

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