Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / How do I get a Sprite's position?

Author
Message
jamesB
8
Years of Service
User Offline
Joined: 2nd Sep 2016
Location:
Posted: 17th Sep 2016 11:48
Hi,
I may be blind, but I couldn't find a function to return a Sprite's position, something llike GetSpritePosition().
Any ideas?
Thanks!
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 17th Sep 2016 12:57
I'm sure it's GETSPRITEX() and GETSPRITEY() - plus the GETSPRITEXBYOFFSET() and GETSPRITEYBYOFFSET() variants.
The code is dark and full of errors
jamesB
8
Years of Service
User Offline
Joined: 2nd Sep 2016
Location:
Posted: 17th Sep 2016 13:25
Great, thanks a lot. I was blind!!

Great engine btw, I'm having a lot of fun with it.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 19th Sep 2016 15:55
If you move the viewport offset, or zoom in/out, then you may also need GetSpriteXFromWorld and GetSpriteYFromWorld

V2 T1 (Mostly)
Phone Tap!
Uzmadesign
JohnStabler
AGK Bronze Backer
11
Years of Service
User Offline
Joined: 16th Aug 2013
Location: Cardiff, Wales, UK
Posted: 19th Sep 2016 19:09
Top tip, CJB

Login to post a reply

Server time is: 2024-09-29 19:29:37
Your offset time is: 2024-09-29 19:29:37