Android to HTML

Monkey Forums/Monkey Programming/Android to HTML

Gruk(Posted 2011) [#1]
Hi Guys, ultimately I want to program for my phone - but its a pain having to either test with the very slow emulator or direct onto my phone..

The res is 480 x 800

I've been compiling up for HTML 5, to test compile, but the screen area is too small - is there a setting somewhere where I can set it the same res as Android?

Dont really want to use autofit at this point as it's a little too complicated having to use delta positions.


Supertino(Posted 2011) [#2]
edit the .html file in .build\html5 folder and change the size from the default 640x480 to 480x800


DruggedBunny(Posted 2011) [#3]

Dont really want to use autofit at this point as it's a little too complicated having to use delta positions.


I'll jump in here -- what do you mean? With AutoFit (just updated!), you set the display size you want to design your game for, then just use VDeviceWidth and VDeviceHeight instead of DeviceWidth and DeviceHeight.

Eg. if you call SetVirtualResolution (480, 800) you can just position things as if they're really on a 480 x 800 display, so 240, 400 will be at the centre, regardless of the actual device's screen size.

EDIT: Just added simple example to demonstrate:

http://www.monkeycoder.co.nz/Community/post.php?topic=1500&post=13702

Anyway, if you still don't fancy it, what he said ^^ :P


therevills(Posted 2011) [#4]
Diddy has an extern function which can alter the HTML5 game canvas on-the-fly:

SetGraphics(480, 800)



Gruk(Posted 2011) [#5]
Thanks guys some useful advice.

I tried the Autofit again - but loading a 480 x 800 background bitmap in, it didnt autosize it when I tried to display it? (half of the bottom was offscreen due to the screen res?)

- Edit.. sorted it