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

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

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

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

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

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

...建显示角度文本 createDegreesText(); Gyroscope.instance.on(Event.CHANGE, this, onOrientationChange); } function createCompass() { compassImg = new Sprite(); Laya.stage.addChild(compassImg); compassImg.loadImage(compassImgPath); compassImg.pivot(compassImg.width / 2, compassImg.height / 2); ...

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