Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
HTML5 Portrait view... - Gideros Forum

HTML5 Portrait view...

SinisterSoftSinisterSoft Maintainer
edited December 2018 in Code snippets
When I write my games that need to work in either orientation I use a 'square' screen (I set the screen width the same as the height), I then put it to letterbox mode and use the extra space by using the application API to figure out what the boundaries are.

Anyhow, for a particular game I wanted to force HTML5 to look like a portrait game, but most desktop users have a landscape viewer. So, how to make this work?

I exported to html5 as normal, then renamed the index.html to index2.html. After this I added the following to a text file and saved it as index.html
<iframe frameborder=0 width=480 height=850 scrolling=no src="<a href="https://sinistersoft.com/PingPongDX/index2.html"></iframe&gt" target="_blank" rel="nofollow">https://sinistersoft.com/PingPongDX/index2.html"></iframe&gt</a>;
Then I uploaded the files and the game looks portrait.

Here is the url for the game I'm working on (if you're interested):

https://www.sinistersoft.com/PingPongDX/

And here it is without the forced portrait:

https://www.sinistersoft.com/PingPongDX/index2.html

Likes: antix

+1 -1 (+1 / -0 ) Share on Facebook

Comments

Sign In or Register to comment.