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

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

21. 输入设备-地图 [ 83%]

...{ const Geolocation = Laya.Geolocation; if (e.code == Geolocation.TIMEOUT) alert("获取位置超时"); else if (e.code == Geolocation.POSITION_UNAVAILABLE) alert("位置不可用"); else if (e.code == Geolocation.PERMISSION_DENIED) alert("无权限"); } } new InputDevice_Map();module laya { import ...

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

22. 请问js怎么触发按钮的onclick事件,按教程的写,触发不知道为什么。 [ 79%]

...写的   export default class btn1 extends Laya.Script { constructor(){ alert("1"); //执行后这里触发了 super();} onEnable(){ alert("2"); //执行后这里触发了 } onclick(){ alert("3"); //执行后点击按钮这里没触发,不知道为什么 //Laya.Scene.open("_game.scene"); } } 2018...

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

23. 为什么说没有​ playByFrame方法 [ 79%]

...0,40,72,30); anifish.on(Event.COMPLETE,this,complete) function complete(){ alert(1) } Monica • 2017-09-27 14:22 @haiboannacom:Event前边加个Laya.看看 haiboannacom • 2017-09-27 14:25 @Monica:第三条鱼我加了这个了。也不行。anifish2那个。那个加了Laya。。。 for (var i = ...

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

24. AS调用IOS原生返回值为undefined,这种情况要怎么解决 [ 79%]

...r bridge = Laya.PlatformClass.createClass("JSBridge");//创建脚步代理 alert(bridge.call("testString:","hello"));   xcode 上的日志: 2020-02-28 17:05:36.608746+0800 djs[18049:1771019] 1 [-1] [1] [JSBridge] [testString:] [["hello"]] 2020-02-28 17:05:36.609592+0800 djs[18049:1771019] alert=u...

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

25. native 1.0.2 连不上wss [ 78%]

...WebSocket("wss://login.huanxi.twbuyu.com:27777"); ws.onopen = function() { alert("connect success~"); ws.send('tom'); alert("send to server msg: tom"); }; ws.onmessage = function(e) { alert("accpet msg: " + e.data); }; ws.onerror = function(e) { alert("error: " + e); console.log(e) }; </script&gt...

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

26. 构建好android studio项目后,debug出错 [ 77%]

构建好android studio项目后,debug出错 I/LayaBox: alert=undefined:5155: SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode let runtime = json.props.runtime; ^^^ SyntaxError: Block-scoped declarations (let, const, function, class) not y...

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

27. 原生语言与JS通信 · LayaAir3.3 · 引擎文档 · LAYABOX [ 77%]

...: var ret = conch.postSyncMessage("syncMessage", "syncMessage from js"); alert(ret); conch.postAsyncMessage("asyncMessage", "asyncMessage from js").then(function (data) { alert(data); }) 1.2 在原生端中主动执行JS端脚本 iOS/OC执行JS脚本: [[conchRuntime GetIOSConchRuntime] runJS:@"a...

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

28. 输入设备-指南针 [ 77%]

... function onOrientationChange(absolute, info) { if (info.alpha === null) { alert("当前设备不支持陀螺仪。"); } else if (firstTime && !absolute && !Browser.onIOS) { firstTime = false; alert("在当前设备中无法获取地球坐标系,使用设备坐标系,你可以继续观赏,但...

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

29. 输入设备-指南针 [ 76%]

...absolute, info) { const Browser = Laya.Browser; if (info.alpha === null) { alert("当前设备不支持陀螺仪。"); } else if (firstTime && !absolute && !Browser.onIOS) { firstTime = false; alert("在当前设备中无法获取地球坐标系,使用设备坐标系,你可以继续观赏,但...

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

30. sprite.loadImage神奇的事情。 [ 76%]

sprite.loadImage神奇的事情。 alert('start load ' + playerInfo.head_url); this.player_head.loadImage(playerInfo.head_url,0,0,playerHeadWH,playerHeadWH,Handler.create(this,function(){ alert('load done'); }) 在微信iphone 6plus里,死活不进这个回调。 在PC浏览器里调试没有任...

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