Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: DrewCCU on Thu 10/06/2010 20:35:51

Title: Get characters screen coordinates
Post by: DrewCCU on Thu 10/06/2010 20:35:51
I need to figure out how to get a characters screen coordinates (NOT room coordinates, as my room is larger than the screen resolution).

I looked into the Character.GetAtScreenXY code but that seems that it only checks if there is a character at screen coordinates but i dont need to check and see if a character is at a specific location ... i need to figure out where the character is in terms of screen coordinates.
Title: Re: Get characters screen coordinates
Post by: discordance on Thu 10/06/2010 20:42:27
You can just subtract the viewport x and y from their coordinates, i.e.


player.x - GetViewportX(),player.y - GetViewportY()
Title: Re: Get characters screen coordinates
Post by: DrewCCU on Thu 10/06/2010 21:14:00
awesome! thanks!