Get an object's absolute position on canvas

Get help using Construct 2

Post » Sat Aug 18, 2012 1:08 am

Hello!
This may be a stupid question, but I've been banging my head on it for awhile now and can't get a solution:

Anybody knows how I could get the absolute position of an object or an object's Image Point on canvas (you know, on the game screen, not the whole layout)?

Thanks!
B
10
S
2
G
4
Posts: 11
Reputation: 2,726

Post » Sat Aug 18, 2012 9:53 am

@mmarcati

Have you tired the get Viewport(Top, Bottom, Left, Right). For example:

ViewportTop = get the Y co-ordinate of the top edge of the layer's viewport

ViewportLeft = get the X co-ordinate of the top edge of the layer's viewport.

You then subtract those values off of your objects positional values to give you a co-ordinate for your current viewport (screen).
B
85
S
31
G
14
Posts: 106
Reputation: 16,440

Post » Thu Aug 30, 2012 3:12 pm

Ooo, great, haven't tried that one! Thanks again, Andemig!
B
10
S
2
G
4
Posts: 11
Reputation: 2,726


Return to How do I....?

Who is online

Users browsing this forum: jobel, Timedoor Indones and 22 guests