Multiple resolutions - solid example

Get help using Construct 2

Post » Mon Mar 26, 2012 2:13 am

Hi folks!

*** The solution proposed on this topic is already obsolete, due to the improvements made over the last two years! There's still some stuff to work on in order to have your UI working flawlessly on different devices, though... :) ***

I'm working on a skeleton project so I don't have to start things from scratch everytime I'm working on a project.
Today I came up with a nice solution for multiple resolutions, avoiding those annoying black bars no matter how stretched your screen is.
It is also ready to be used no matter the orientation: You just have to change the layout sizes to a portrait orientation (say, 640x960).
Hope it helps! I still have a lot of things to add on the skeleton (level selector, sound options, facebook integration), but this is was a nice start, so I wanted to share it with you.
See ya!
Last edited by gammabeam on Tue May 27, 2014 11:54 am, edited 1 time in total.
B
107
S
40
G
10
Posts: 456
Reputation: 13,202

Post » Mon Mar 26, 2012 2:31 am

Link is a 404!
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Mon Mar 26, 2012 2:34 am

Whoops forgot to enable Dropbox Sync!
Done!
B
107
S
40
G
10
Posts: 456
Reputation: 13,202

Post » Wed Mar 28, 2012 10:42 pm

UP
Did anyone even see this?

I've tested over different iOS and Android devices, and it is working very well!
B
107
S
40
G
10
Posts: 456
Reputation: 13,202

Post » Wed Mar 28, 2012 11:02 pm

I hadn't seen this. Thanks for the bump.

It sounds like exactly what I need. Will download. Thanks.
ImageImage
Mr. Green - Platform/puzzle game out now!
B
24
S
7
G
1
Posts: 222
Reputation: 3,325

Post » Wed Mar 28, 2012 11:48 pm

Nice demo, that's how it's meant to be done :)
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Wed Apr 11, 2012 11:26 pm

This should be sticky, I wish I'd seen it before..
Why are you setting this: "(LayoutHeight * scaleRatio - WindowHeight) / 2 / scaleRatio" technically the result would always be 0? Or am I missing something?


EDIT: Also how is it that the element in your canvas stay magically centered?

EDIT2: Disregard that I'm stupid, I didn't see the unbounded scrolling0plus12012-04-11 23:47:45
B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Thu Apr 12, 2012 10:03 am

Yes, unbounded scrolling must be on so this can work :)

I've made this example but hadn't used it since, so let me know if you find any bugs or weird behaviors.
B
107
S
40
G
10
Posts: 456
Reputation: 13,202

Post » Sun Apr 15, 2012 6:28 pm

Thanks for the info gammabeam

@Ashley
I'm still running into the same problem with scale. Maybe this will explain.

FullScreenTest.capxThunder2012-04-15 19:44:40
B
5
S
2
G
5
Posts: 26
Reputation: 2,987

Post » Sun Apr 15, 2012 7:48 pm

@Thunder, aren't you just missing the layer parameter for the Touch.X/Y expressions?

Both mouse and touch take an optional layer parameter, e.g. Touch.X("Layer 1"). If that's not provided, the returned value does not take in to account any layer's scale.
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Next

Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go and 21 guests