Request/Question - Center of scaled game

Get help using Construct 2

Post » Thu Sep 19, 2013 12:58 pm

My game uses scale outer so it does scaling by construct2 magic.
I want to put something on the middle of the screen.
WindowWidth/Height returns value of unscaled game window/height.

Example:
GameView width is 400 but canvas is 600 so everything gets scaled by 1.5
If i use windowwidth/2 i will get 300 and not 200 wchich I need and want.

thats perfect case because scale can be just anything.


Why isnt it implemented by default in c2? ScaledWidth and ScaledHeight? Can I get some "GameScale" value anywhere?
B
22
S
7
Posts: 94
Reputation: 1,783

Post » Thu Sep 19, 2013 1:16 pm

scrollX and scrollY might be what you are looking for.
B
24
S
9
G
7
Posts: 756
Reputation: 7,292

Post » Thu Sep 19, 2013 2:17 pm

ViewportRight(layer)/2

ViewportBottom(layer)/2
Image ImageImage
B
168
S
50
G
163
Posts: 8,221
Reputation: 105,061

Post » Thu Sep 19, 2013 4:13 pm

ScrollX/ScrollY would be correct if game wasnt scaled. When it is scaled, values are wrong.

ViewportRight - same problem, if game uses any scaling value readings are wrong.


Or im pretty much complete retard but its bit annoying there is no access to "scale" property anywhere.
B
22
S
7
Posts: 94
Reputation: 1,783


Return to How do I....?

Who is online

Users browsing this forum: Rudi55 and 6 guests