Hi there! I’m trying make my game run on portrait mode on poki.
In desktop and lanscape all good, but when I try mobile:
How you guys do full portrait on poki? Any leads? I’m a bit lost here
Hi there! I’m trying make my game run on portrait mode on poki.
In desktop and lanscape all good, but when I try mobile:
How you guys do full portrait on poki? Any leads? I’m a bit lost here
Are you able to get the iframe viewport size with JS? Try debugging that.
They never accepted me into their program so I can’t give you good tips unfortunately.
This topic interests me because I have Poki as target soon.
Use “Stretch” mode for HTML5 Defold development for the HTML5 platform
There is no concept of screen orientation in HTML5. In fact, the canvas of your game should occupy all available space. Portrait mode is when the width of the canvas is less than the height.
I’m going through this situation now. Because the game is HTML5, you can’t check for the device. I think the best solution is something like this
local w,h = window.get_size()
If w < h, then the game will be in portrait mode.
I run this check when the game loads/resets and then set up the game accordingly.
You are the goat, thanks . Totally missed that piece of the manual.
Yes I’m doing the same thing “If w < h”
I’m using these in my render script:
local window_width = render.get_window_width()
local window_height = render.get_window_height()
I’m using the Orthographic Camera library with projection “FIXED_AUTO”, with a custom script, to zoom in and out when needed.
Also this message “window_resized” to detect when the device is rotated. So far so good.
Topic saved as source of information.