resizable interface according to the screen size?

Get help using Construct 2

Post » Tue Jan 21, 2014 7:39 pm

Hello everyone!

Well, i recently saw a lot of games using this style of interface but i dont really know how to get a interface that always stays in the corners of the screen, the only interface i know how to do is a layer with parallax in 0,0 but i know that there is a way to do this:

(red dots are the interface)


Does someone know how to do that?IJCT2014-01-21 19:43:54
Image

Image
B
38
S
14
G
7
Posts: 408
Reputation: 8,338

Post » Tue Jan 21, 2014 7:50 pm

Hi,

i think its calulating the x,y positions of the interface objects according to the "WindowWidth" and "WindowHeight" system variables.

For example:
positioning the right top object to:
y: YOffset
x: WindowWidth - ObjectWidth - XOffset

Where as the offsets define how far from the edge the object should be

Same goes for the others:

right bottom:
x: WindowHeight - ObjectHeight - yOffset
y: WindowWidth - ObjectWidth - XOffset

left top:
y: yOffset
x: xOffset

left bottom:
y: WindowHeight - ObjectHeight - yOffset
x: xOffset5Type2014-01-21 19:52:38
B
22
S
7
G
4
Posts: 154
Reputation: 3,709

Post » Tue Jan 21, 2014 7:58 pm

Construct2 has the anchor-behaviour for this..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jan 21, 2014 8:06 pm

thanks! i ll try to do it by the 2 methods :)
Image

Image
B
38
S
14
G
7
Posts: 408
Reputation: 8,338

Post » Tue Jan 21, 2014 8:13 pm

it works! thanks!
Image

Image
B
38
S
14
G
7
Posts: 408
Reputation: 8,338

Post » Sat Jan 25, 2014 2:25 am

[QUOTE=5Type] Hi,

i think its calulating the x,y positions of the interface objects according to the "WindowWidth" and "WindowHeight" system variables.

For example:
positioning the right top object to:
y: YOffset
x: WindowWidth - ObjectWidth - XOffset

Where as the offsets define how far from the edge the object should be

Same goes for the others:

right bottom:
x: WindowHeight - ObjectHeight - yOffset
y: WindowWidth - ObjectWidth - XOffset

left top:
y: yOffset
x: xOffset

left bottom:
y: WindowHeight - ObjectHeight - yOffset
x: xOffset[/QUOTE]


i got a question,
what means XOffset and YOffsets?
Image

Image
B
38
S
14
G
7
Posts: 408
Reputation: 8,338


Return to How do I....?

Who is online

Users browsing this forum: MassimoF and 21 guests