Multiple screen ratios in CocoonJS

Discussion and feedback on Construct 2

Post » Sun Feb 16, 2014 2:35 pm

Hi,

I've spent 3 days on trying to make an app that looks pretty on 16:9 (iphone 5) and ipads (4:3).

I have not succeed so I am considering to make several version of the app adapted to different screen ratios. 16:9 and 4:3, maybe eve, 3:2.

What i really really want to know it's if it's possible to upload different app versions of a game i did in cocoonjs for different devices/ratios.
Like ipad version a 16:9 supported version of the app, iphone version 4:3 supported version...
Making multiple version is not an issue, what is an issue is to get them work on any mobile device.

So my question is there an option in cocoonjs to upload different versions without uploading different games, i mean upload everything in the same project without being forced to make a project for each version of my game.

Thank you!
B
12
S
4
G
1
Posts: 241
Reputation: 1,699

Post » Sun Feb 16, 2014 3:26 pm

@vagaev

whatever you will do - CocoonJS will ALWAYS export your app as a "Universal" :) And changing things in Xcode will not give any results (iTunes will still see your app as "Universal")

just FYI

B
18
S
6
G
1
Posts: 783
Reputation: 4,187

Post » Sun Feb 16, 2014 4:17 pm

Damn.. How will i be able to make my game compatible with 16:9 and 4:3 devices ?
Any ideas?
B
12
S
4
G
1
Posts: 241
Reputation: 1,699

Post » Sun Feb 16, 2014 4:32 pm

make 4:3 window size
but 16:9 layout size
on start layout - scroll to center of layout
don't put important things on left and right border :)
for HUD objects (Score etc.) use anchor behaviorszymek2014-02-16 16:34:11
B
18
S
6
G
1
Posts: 783
Reputation: 4,187

Post » Sun Feb 16, 2014 6:54 pm

GOD HAIL THE PIG it works.
Thank you!
B
12
S
4
G
1
Posts: 241
Reputation: 1,699

Post » Sun Feb 16, 2014 8:03 pm

I just went through this. I used a couple techniques, a couple are already mentioned.

I use a centering device, it's a sprite that I pin all my UI objects to, then I set the sprite to scrollx, scrolly. This usually centers it nicely on the phones.

Anchor is also really great, although it flickers for me, and I'm still working on how to fix that.

Make sure your backgrounds are large enough for all devices. The easiest test is to load it in the browser, and resize the browser and hit refresh, if it looks good there, it will be nice in any phone.
B
30
S
10
G
7
Posts: 416
Reputation: 7,239

Post » Sun Feb 16, 2014 8:55 pm

Here's another example of how you could manage it, without using the anchor behavior - example.
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,188

Post » Sun Feb 16, 2014 11:51 pm

Thanks dudes! I will try them all.
B
12
S
4
G
1
Posts: 241
Reputation: 1,699

Post » Mon Feb 17, 2014 4:14 am

I build my games at Windows 8 min size 1366/768. When I place my HUD objects I make sure I leave enough space for them to move if the screens are too small. That way when they are anchored, they stay in relative position to the sides of the screen. Don't bunch all of your hud elements together or they will cause issues. Leave enough space near them and test on multiple screens to find a size that works. OR...

You can also test for the size of the viewport/window and have multiple invisible sprites on the screen, then based on the size of the window, snap your hud objects to different invisible sprites. For example if I have score and high score next to each other on larger screen, I may have to move score below high score on narrower screens so they don't overlap or go off the screen. With a bit of forethought you can do lots of neat things to account for screen sizes...
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,573

Post » Mon Feb 17, 2014 4:28 am

@firebelly

I create invisible object with anchor, and then, after 0.01s, make it visible... I prefer that than "moving" anchor on every layout startszymek2014-02-17 04:28:34
B
18
S
6
G
1
Posts: 783
Reputation: 4,187

Next

Return to Construct 2 General

Who is online

Users browsing this forum: jefftrier and 9 guests