A way to deal with scaled games and alt+Enter?

Get help using Construct 2

Post » Fri Apr 27, 2012 4:01 pm

Hi
I'm working on a game set to full screen (scaled), which works great under normak conditions, BUT if I press alt+Enter to make the brower to go into total full screen mode, the wondow size changes and some things loose their apropriate position.

Is there a way to detect when someone changes the browsers screen mode via alt-enter or a menu and auto correct things as it clearly did when starting up?

This is NOT going from non-"full screen" to "full screen". These are two varients of "full screen"
make sense?
B
47
S
9
G
4
Posts: 421
Reputation: 6,959

Post » Fri Apr 27, 2012 4:47 pm

You should position things every tick, or with the Anchor behavior (which positions every tick) - presumably you're just positioning stuff once on startup which breaks when the window size changes.
Scirra Founder
B
382
S
223
G
86
Posts: 24,003
Reputation: 189,833

Post » Fri Apr 27, 2012 7:20 pm

How would I position a Sprite at the top visible Y coordinate?
B
47
S
9
G
4
Posts: 421
Reputation: 6,959

Post » Fri Apr 27, 2012 7:53 pm

Use anchor to the top.
Alternatively, for more control, set position to:
scrolly + windowheight - sprite.height/2 - buffer

buffer is the distance from the top of the screen.
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,644

Post » Fri Apr 27, 2012 8:40 pm

Hmmm. Id use anchor to top..but it doesnt seem like theres a way to turn off anchoring versus one side or the other. Why can't i JUST anchor to top?
B
47
S
9
G
4
Posts: 421
Reputation: 6,959


Return to How do I....?

Who is online

Users browsing this forum: Carlafnt, imhotep22, rollyzz, scitana, Silviu and 11 guests