[英]Phonegap canvas not drawing on android but works fine in browser
I've made a simple HTML5 noughts and crosses(tic tac toe) game that uses the canvas element and I am trying to use phonegap to get it working on Android. 我制作了一个使用canvas元素的简单HTML5棋盘游戏(井字游戏),并且我试图使用phonegap使其在Android上正常工作。 I've test it works fine on firefox, chrome and internet explorer but when I get built using phonegap the apk produced simply renders a white screen.
我已经测试了它在Firefox,Chrome和Internet Explorer上的正常运行,但是当我使用phonegap构建时,生成的apk只会呈现白色屏幕。
I've tried using the ripple emulator and it renders and behaves as expected fine. 我试过使用波纹模拟器,它可以呈现并表现出预期的效果。 Really confused as to why its not working.
关于它为什么不起作用真的很困惑。
To work on pc instead of phoengap you have to change document.addEventListener("deviceready",onDeviceReady, false);
要在PC上工作而不是phoengap,必须更改
document.addEventListener("deviceready",onDeviceReady, false);
to document.addEventListener("DOMContentLoaded",onDeviceReady, false);
到
document.addEventListener("DOMContentLoaded",onDeviceReady, false);
in main.js. 在main.js中。
I am using fast-canvas as a plugin, see the config file. 我使用快速画布作为插件,请参阅配置文件。 Code is avaliable here as well as assets here: https://github.com/JacobRawling/XandOs Please help I am very confused and am struggling to find any phonegap tutorials that use canvas.
代码在这里可用,在这里也可以使用: https : //github.com/JacobRawling/XandOs请帮助我,我非常困惑,并且正在努力寻找使用画布的所有phonegap教程。
Thanks very much 非常感谢
Your solution is jqscribble – A touch enabled canvas drawing tool 您的解决方案是jqscribble –具有触摸功能的画布绘制工具
http://plugins.jquery.com/jqscribble/ http://plugins.jquery.com/jqscribble/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.