Hi, I’ve been trying to use cocoonjs to get a html5 game made in GameDevelop to work on android devices. I’m having an issue to do with different screen sizes.
In GameDevelop I enable fullscreen so that the game will stretch to fit whatever screen size it is played on(which works well), but then the touch screen area gets distorted.
I have the window width and height set to 800 x 480 (my galaxy s2 resolution) but when I load the game up on a smaller screen device, the touch screen only registers as using a smaller portion of the game than I can see.
I’ve attached an image that hopefully explains what I mean a bit better.
Is there a setting in GameDevelop that I should be changing which could help fix this?
Aw damn, haha. Thank you for the reply. I’ve been trying to make this work by playing around with the javascript file after compiling the game for web.
I can change it in some interesting ways, I can get the touchscreen to work for the full area but the problem sort of inverts. The whole screen isnt visible anymore (fullscreen stops working) but the character will walk off screen right up to the corners of the map.
I suppose only 4ian would be able to help me there though, I’m no coder and I’m really just tinkering with no proper knowledge.
It seems that touch coordinates are indeed wrong when using CocoonJS: I’ll try to fix it.
In any case, you should always activate fullscreen when using CocoonJS: The exporter for CocoonJS that will be available one day (For now, there is still issue when rendering texts) will force the usage of fullscreen
It’s fixed for the next version: the touch events location where incorrect for CocoonJS (and also for other touchscreen devices when fullscreen was activated).
I’ve also forced the use of fullscreen when lauching a game with CocoonJS.
So there is only a bug related to text not showing properly and audio support still lacking and games should then be fully compatible with CocoonJS.
That’s great news! thankyou! I actually just solved the problem for now anyway, I just changed the mouse location in the javascript file to account for the screen size difference.
This will be amazing once those bugs are gone too! Will the Scenes work with cocoonJS aswell?