1 decade ago by Jon123
I've been trying to convert the physics demo into an apk using cocoonjs, which involved coding the canvas using js instead of putting it in the index.html file:
The problem is that the touch buttons don't appear on the phone, you can touch anywhere on the screen though and the jetpack guy boosts...
Anyone know where I am going wrong?
Thanks
var obj = document.getElementById('game') var c = document.createElement('canvas'); c.id = 'canvas'; obj.appendChild(c); var b1 = document.createElement('div'); b1.id = 'buttonLeft'; b1.className = 'button'; obj.appendChild(b1); var b2 = document.createElement('div'); b2.id = 'buttonRight'; b2.className = 'button'; obj.appendChild(b2); var b3 = document.createElement('div'); b3.id = 'buttonShoot'; b3.className = 'button'; obj.appendChild(b3); var b4 = document.createElement('div'); b4.id = 'buttonJump'; b4.className = 'button'; obj.appendChild(b4);
The problem is that the touch buttons don't appear on the phone, you can touch anywhere on the screen though and the jetpack guy boosts...
Anyone know where I am going wrong?
Thanks