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

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

281. 安卓无法调用后置摄像头 [ 54%]

...ction () { if (!LayaAir3D.video.videoWidth) { return; } laya.utils.Browser.document.body.appendChild(LayaAir3D.video); clearInterval(interval); }, 1000 / 50); }); }).catch(function (error) { onError({ message: error.message }); }); 2018-02-17 添加评论 免费帖 --> 分享 微博 QZONE 微信 没...

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

282. 新手引导 挖洞 不用 cacheAs="bitmap" 希望能帮助那些和我一样有需求的码农!你好我好大家好才是真的好!请各位大佬批评指教! [ 54%]

...   // 获取canvas元素对应的DOM对象         var canvas = document.getElementById('canvas');         var div1 = document.getElementById('div1');          // 获取在canvas上绘图的CanvasRenderingContext2D对象         var ctx = canvas.getContext('2d');...

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

283. 如何使用原生canvas的api在laya封装的canvas上进行绘图 [ 54%]

...件,官方封装的矢量api无法满足需求   代码: var canvas = document.getElementById('layaCanvas');         var ctx=canvas.getContext("2d");         ctx.fillStyle="#0000ff";          ctx.fillStyle="#0000ff";          ctx.fillRect(200,200,15000,100); 这样是白屏的...

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

284. 请问如何监听html的button元件ontouchstart,ontouchend等事件 [ 54%]

...click的监听事件。this.btn_CloseWebiFrame = laya.utils.Browser.window.document.createElement('button'); this.btn_CloseWebiFrame.onclick = () => { console.log("onclick"); };  oncontextmenu也没有问题。this.img_closeWebiFrame.oncontextmenu = () => { console.log("aaa4"); this.img_close...

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

285. 关于 Laya.stage.bgColor 背景双色 ( 从浅到深 ) [ 54%]

... 状况可以利用一下JS代码 来到达 背景 双色 的目的var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); var my_gradient = ctx.createLinearGradient(0, 0, 0, 170); my_gradient.addColorStop(1, "#0066ff"); my_gradient.addColorStop(0, "#ccffff"); ctx.fillStyle = my_g...

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

286. LocalStorage 在Native下的具体实现? [ 54%]

...的ios就有几种方法。 或以文件的方式存储在本地存储域 Document中。 或者是存储在KeyChain 中。     2017-12-25 0 1 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 要回复问题请先登录 发起人 bearocean 相关问题 微信关系链:LayaAir...

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

287. t._addReference is not a function [ 54%]

...api readFile fail callback function 用微信开发者调试的时候出现document.createTextNode is not a function ide导出ui时,UI代码显示不正常在小游戏中会报错:gameThirdScriptErrorn.sort is not a function api readFile success callback function undefined 官方视频教程中...

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

288. 在移动浏览器原生js无法获取引擎canvas的点击事件,pc是正常的,不能穿透? [ 54%]

...7 14:55 浏览: 1168 关注: 2 人 fqny17951 • 2017-07-27 16:01 canvas = document.getElementById('layaCanvas'); canvas.addEventListener('touchend', runclick); canvas.addEventListener('click', runclick); 已经自己解决了,移动对click事件支持不好,只能用touchend了 cuixueying • ...

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

289. 播放视频只有声音没有图像 [ 54%]

...素 let videoElement = Laya.Browser.createElement("video"); Laya.Browser.document.body.appendChild(videoElement); videoElement.style.zInddex =Laya.Render.canvas.style.zIndex + 100; videoElement.controls = false; videoElement.autoplay =true; videoElement.style.width='100%'; videoElement.style.height=...

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

290. 通过laya嵌入iframe 后 原本laya禁止微信浏览器里面的上下滑动,又开始上下滑动了 [ 54%]

...构造函数里添加以下代码即可! //屏蔽手机端页面滑动  document.ontouchstart=function()  {    return false;  } 2017-12-19 2 0 分享 微博 QZONE 微信 anghuo 赞同来自: 这个怎么禁止呀! 2017-12-19 0 0 分享 微博 QZONE 微信 为什么被折叠? 0 个回复...

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