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

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

1. 输入设备-摇一摇 [ 100%]

...t Shake = Laya.Shake; Shake.instance.start(5, 500); Shake.instance.on(Laya.Event.CHANGE, this, this.onShake); console.text = '开始接收设备摇动\n'; } onShake() { const Shake = Laya.Shake; shakeCount++; console.text += "设备摇晃了" + shakeCount + "次\n"; if (shakeCount >= 3) { Shake.inst...

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

2. 输入设备-指南针 [ 88%]

...ler.create(this, this.init)); } init() { const Gyroscope = Laya.Gyroscope, Event = Laya.Event; // 创建罗盘 this.createCompass(); // 创建方位指示器 this.createDirectionIndicator(); // // 画出其他UI this.drawUI(); // // 创建显示角度的文本 this.createDegreesText(); Gyroscope.ins...

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

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

... Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler = Laya.Handler, Event = Laya.Event, Accelerator = Laya.Accelerator; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.width, Browser.height, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; La...

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