How do I get screen space coordinates for a sprite object?

Get help using Construct 2

Post » Thu May 19, 2016 4:43 pm

I need to be able to tell where an object is on the screen, as opposed to where it is on the layout. I couldn't see anything in the manual about it. Anyone able to help out? My own brain is a bit fried after work :P
B
42
S
16
G
6
Posts: 544
Reputation: 7,701

Post » Thu May 19, 2016 5:54 pm

Compare scrollx and scrolly to sprite.x and sprite.y
B
24
S
4
G
3
Posts: 69
Reputation: 2,749

Post » Thu May 19, 2016 6:42 pm

See the expressions

ViewportBottom(layer)
ViewportLeft(layer)
ViewportRight(layer)
ViewportTop(layer)
OriginalWindowWidth
OriginalWindowHeight
WindowWidth
WindowHeight

https://www.scirra.com/manual/126/system-expressions
B
33
S
18
G
29
Posts: 2,493
Reputation: 21,450

Post » Thu May 19, 2016 9:43 pm

Thank you both for the help, I got my screen coordinates now :)
B
42
S
16
G
6
Posts: 544
Reputation: 7,701


Return to How do I....?

Who is online

Users browsing this forum: havana97 and 5 guests