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
38
S
16
G
6
Posts: 537
Reputation: 7,582

Post » Thu May 19, 2016 5:54 pm

Compare scrollx and scrolly to sprite.x and sprite.y
B
22
S
4
G
3
Posts: 61
Reputation: 2,683

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
27
Posts: 2,430
Reputation: 20,324

Post » Thu May 19, 2016 9:43 pm

Thank you both for the help, I got my screen coordinates now :)
B
38
S
16
G
6
Posts: 537
Reputation: 7,582


Return to How do I....?

Who is online

Users browsing this forum: Twili and 1 guest