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

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

271. 输入设备-指南针 [ 78%]

...ignV = Stage.ALIGN_MIDDLE; Laya.loader.load(compassImgPath, Handler.create(this, init)); })(); function init() { // 创建罗盘 createCompass(); // 创建方位指示器 createDirectionIndicator(); // 画出其他UI drawUI(); // 创建显示角度的文本 createDegreesText(); Gyroscope.instance.on...

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

272. 点击拖动图片,当鼠标移出再移回舞台中时如何保持点击状态 [ 78%]

...wn,down下开始move,up时移除move和up事件 sp.on(Event.MOUSE_DOWN,this,onDown); Laya.stage.on(Event.MOUSE_UP,this,onUp); } private function onUp():void { Laya.stage.off(Event.MOUSE_MOVE,this,onMove); } private function onDown(e:Event):void { Laya.stage.on(Event.MOUSE_MOVE,this,onMove); } pr...

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

273. layaAir真的没办法做涂鸦板? [ 78%]

...Laya.Sprite(); Laya.stage.addChild(s); Laya.stage.on(Laya.Event.MOUSE_DOWN,this,function(e){ arr.push([e.stageX,e.stageY]); Laya.stage.on(Laya.Event.MOUSE_MOVE,this,bb) }) Laya.stage.on(Laya.Event.MOUSE_UP,this,function(){ Laya.stage.off(Laya.Event.MOUSE_MOVE,this,bb) }) function bb(e){ s.graphics.c...

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

274. 输入设备-指南针 [ 78%]

...stage.bgColor = "#232628"; Laya.loader.load(compassImgPath, Handler.create(this, this.init)); } init() { const Gyroscope = Laya.Gyroscope, Event = Laya.Event; // 创建罗盘 this.createCompass(); // 创建方位指示器 this.createDirectionIndicator(); // // 画出其他UI this.drawUI(); // // 创...

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

275. 这样的panel请问如何实现比较好? [ 78%]

.../点击最先出来的按钮,会显示下一层界面,同时隐藏自己 this.btnFirst.on(Laya.Event.CLICK, this, this.change, [0]); //点击上面一层的按钮,会隐藏该层,同时显示上一层 this.btnChange.on(Laya.Event.CLICK, this, this.change, [1]); //初始时默认上面一层不...

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

276. 输入设备-贪吃蛇(重力感应) [ 78%]

...r; var WebGL = Laya.WebGL; function Segment(width, height) { Segment.super(this); Segment.prototype.init = function() { this.graphics.drawRect(-height / 2, -height / 2, width + height, height, "#FF7F50"); } // 获取关节另一头位置 Segment.prototype.getPinPosition = function() { var radian = t...

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

277. UI运行时 · LayaAir3.0文档 · LAYABOX [ 78%]

...件脚本中,使用此场景中已经勾选过的UI组件,直接使用this.即可使用。例如下面的代码: onAwake(): void { // Button添加鼠标事件,让Image不显示 this.Button.on( Laya.Event.MOUSE_DOWN, this, ()=>{ this.Image.visible = false; }); } 运行此场景来看看效...

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

278. 输入设备-贪吃蛇(重力感应) [ 77%]

...ode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; // 初始化蛇 this.initSnake(); // 监视加速器状态 Accelerator.instance.on(Event.CHANGE, this, this.monitorAccelerator); // 游戏循环 Laya.timer.frameLoop(1, this, this.animate); // 食物生产 Laya.timer.loop(3000, this, this.pr...

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

279. ReferenceError: Loader is not defined 搞不懂引擎原生的也会报这个错? [ 77%]

...每次获取组件带来不必要的性能开销 thi   s._loveControl = this.getComponent(LoveControl);  //点击提示文字,开始游戏 this.label_start.on(Laya.Event.CLICK, this, this.onTipClick); //this._loveControl.startGame();  //点击重置按钮,重新开始 this.button_reset.on(Lay...

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

280. radioGroup设置labels后,每个radio的icon皮肤无法显示了 [ 77%]

...p();          dialog.btn_question_dialog_next.on(Laya.Event.CLICK, this, onNext); dialog.radioGroup_question.labels = "如果资源未加载,则先加载资源,\n加载完成后应用于此对象。,"+"如果资源未加载,则先加载资源,\n加载完成后应用于此对象。,"+...

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