简体   繁体   中英

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. 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.

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); to document.addEventListener("DOMContentLoaded",onDeviceReady, false);

in 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.

Thanks very much

Your solution is jqscribble – A touch enabled canvas drawing tool

http://plugins.jquery.com/jqscribble/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM