How to support multiple screen sizes Android

Get help using Construct 2

Post » Fri Feb 14, 2014 8:48 am

Okay so I've read the forums regarding this particular issue, and I've found some topics on it, but nothing was as clear and straight forward as it should be. Is there any one that can simply state in the easiest way possible what is the easiest way to support multiple screen sizes for android? Where do I start, what do I do in the middle, where do I begin? I really want to make Scirra made-games thrive on every market possible I want to create the best fitting game as best as I can, so this will help me out and others a lot. Thank you for your time.
B
6
S
1
Posts: 89
Reputation: 619

Post » Fri Feb 14, 2014 8:53 am

The best mentioned approaches involve setting the full screen to scale outer.

There are quite some topics and capx's relating to this in the forum.

generally it is setting scale outer, and have a some extra layout imagery around your layout size to reduce black lines at the sides or bottom/top.

Scale outer will try and stretch your viewport till either the widest or highest side of your viewport matches the users window.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Fri Feb 14, 2014 11:49 am

As mentioned above, I use Scale Outer.
B
56
S
15
G
13
Posts: 825
Reputation: 17,643

Post » Fri Feb 14, 2014 1:53 pm

Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,240

Post » Fri Feb 14, 2014 5:26 pm

Well, you could create a system which can update the positions of your objects so that they always stay in a relative position to the window size, and stretch (with/without preserving the aspect ratio, maintain size relative to screen width/height) them as necessary.

Here's a thread where i posted how the end result should look like (proof that this is very much possible in C2), however it isn't made with the best practices and therefore would introduce bugs into something faster paced such as games: http://www.scirra.com/forum/your-c2-tests_topic41840_page57.html

Also, a direct link for the lazy: https://dl.dropboxusercontent.com/u/80437109/LimbaziLive/web-test/index.html

Something that i should mention is that you'll probably have problems with the touch controls / mouse input coordinates when using the scale outer mode, i had to re-create a new system (2 global variables for both the X and Y coordinates) that takes the viewport sizes into account, just to be able to precisely read the input... :/Stiivais2014-02-14 17:27:09
B
10
S
1
Posts: 163
Reputation: 1,436

Post » Fri Feb 14, 2014 5:34 pm

@Stiivais you can use touch.x("Layername") (or mouse.X("Layername")) which grabs the X according to the layers scale and or paralax.

;)lennaert2014-02-14 17:34:33
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,562

Post » Fri Feb 14, 2014 7:34 pm

Not sure about others, but for me Scale Inner has had much better results than Scale Outer...
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,573

Post » Sun Feb 16, 2014 2:24 am

Thanks a lot everyone, your responses are really helping me to understand construct just a little more every time. Another question, more specified this time, I have a game that I`m currently working on aside from my other projects of course, and it`s layout size is set to 400, 500, -- it`s margin size is set to 400, 500 -- and it`s window size is set to 400, 500 -- now I understand that using scale outer or inner will help me to accomplish compensation of varying screen sizes, but can I get a specific example using the numbers I just gave perhaps how to allow this game to be able to be presentable to the android user of, Samsung Galaxy S1 = 480 x 800 -- and The Samsung galaxy S3 = 720 x 1280. Would I have to target the Samsung Galaxy S1 screen size specifically or would I have to target the S1 and then size it down?
B
6
S
1
Posts: 89
Reputation: 619

Post » Mon Feb 17, 2014 10:03 am

[QUOTE=lennaert] @Stiivais you can use touch.x("Layername") (or mouse.X("Layername")) which grabs the X according to the layers scale and or paralax.

;)[/QUOTE]


Thank you so much!! I had a MASSIVE bug and i didn't know why my mouse controls where gradually more inaccurate as the camera zoomed out / as the layer was scaling. I was using just "Mouse.X, Mouse.Y", and know with your suggestion I use "Mouse.X(1), Mouse.Y(1)" and it works like a dream!! Now accurate mouse controls camera zoomed in or out.

Thanks a million!!
B
34
S
5
G
1
Posts: 78
Reputation: 3,397

Post » Mon Feb 17, 2014 10:19 am

[QUOTE=EddyDingDongs] [QUOTE=lennaert] @Stiivais you can use touch.x("Layername") (or mouse.X("Layername")) which grabs the X according to the layers scale and or paralax.
;)[/QUOTE]
Thank you so much!! I had a MASSIVE bug and i didn't know why my mouse controls where gradually more inaccurate as the camera zoomed out / as the layer was scaling. I was using just "Mouse.X, Mouse.Y", and know with your suggestion I use "Mouse.X(1), Mouse.Y(1)" and it works like a dream!! Now accurate mouse controls camera zoomed in or out.
Thanks a million!! [/QUOTE]
I tried that, but it didn't work for me. Then again, i was using two coordinate systems for positioning the objects (the default in C2 and also my own for scaling and positioning the objects relative to the default layout size. don't ask me why, it just was faster in regards to positioning the objects in the editor. or something...)Stiivais2014-02-17 10:21:12
B
10
S
1
Posts: 163
Reputation: 1,436

Next

Return to How do I....?

Who is online

Users browsing this forum: ramyaswetha and 5 guests