Multiple Screen Size Issue

Get help using Construct 2

Post » Sat Feb 22, 2014 11:24 pm

I'm trying to adapt my game to be suitable for multiple screen sizes, but I'm having trouble with 2 things.

1) I want the player to be bound to the viewable screen, but I can't make the player solid because of game mechanics and I can no longer use the "Bound to layout" behavior because I'm using "Scale Outer" and I don't know what the width of the screen will be. No matter what I set the width of the layout to be, it won't be right for every device.

2) I have enemies spawning on the right side of the layout, but now that the screen can be wider than the layout, they might spawn near the middle of the screen on some devices. I'd like for them to spawn out of view.

The event I'm using for spawning enemies is this...
Condition:
System - Every 2.0 seconds
Action:
Create object "enemy" on layer "enemyLayer" at (800,random(0,600))

The current layout is 800x600. Any help would be appreciated. Thanks!
Last edited by Fwumpy on Sun Feb 23, 2014 12:19 am, edited 1 time in total.
B
3
S
1
Posts: 39
Reputation: 405

Post » Sat Feb 22, 2014 11:48 pm

Change the 600 in your random to ViewportBottom(a layer number).
B
147
S
74
G
20
Posts: 1,786
Reputation: 22,527

Post » Sat Feb 22, 2014 11:52 pm

Use this:

https://dl.dropboxusercontent.com/u/169 ... utions.png

Set this as the last layer and when all is done just delete it and compile your game.
Set project window size to 640:960 and basicly set everything important (that needs to be seen) into the smalest screen aspect ratio (iphone4) and make sure that background covers both biger aspects (iphone 5 and ipad) and your good to go... and spawn everything that needs to enter screen from outside bigger aspest ratios also!
(if you are more expirienced than you can use anchors to stretch visible objects to fit into every aspect ratio)
and yes... use scale outer.
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Sun Feb 23, 2014 12:43 am

@alspal
I tried:
Create object "enemy" on layer "enemyLayer" at (ViewportRight(6),random(0,600))
And it works. Thanks for your help!

Is there a way to bound the player object to the Viewport instead of the layout?

@Irina
That's going to help me a lot, thanks! Is there an android version?
B
3
S
1
Posts: 39
Reputation: 405

Post » Sun Feb 23, 2014 12:46 pm

@Fwumpy

Theres no need for some "android" version becouse this covers basicly all screen aspects ratios (resolutions are irrelevant).
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Sun Feb 23, 2014 5:23 pm

@Irina
Great! And thanks again for the ratio guide. I don't have an iPhone 5, but I feel I can see how may game might look at that screen size. :)
B
3
S
1
Posts: 39
Reputation: 405

Post » Sun Feb 23, 2014 7:37 pm

@irina does this guide works for all ipads? What aspect ratios do that guide represents, 3:2 4:3 and 16:9 right?
B
12
S
2
Posts: 94
Reputation: 949

Post » Sun Feb 23, 2014 8:11 pm

@sachos345

That's correct.
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Post » Mon Feb 24, 2014 12:16 am

Thanks man that guide is awesome xD
B
12
S
2
Posts: 94
Reputation: 949

Post » Mon Feb 24, 2014 1:20 am

@Fwumpy @irina
http://i.imgur.com/fVPYfr3.png
I took the job to make it better, hope it helps =)
17:10 is 1024x600
16:9 1280x720
16:10 1280x800
3:2 1152x768
4:3 1024x768
5:3 1280x768
B
12
S
2
Posts: 94
Reputation: 949

Next

Return to How do I....?

Who is online

Users browsing this forum: David181, jorgmaquoi, unicornspitfire and 29 guests