Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Goot on Thu 01/07/2004 04:04:31

Title: Getting mouse room coordinates
Post by: Goot on Thu 01/07/2004 04:04:31
Is there a way to get the mouse room coordinates in a scrolling screen? At one point I remember seeing variables for how much the screen is scrolled, which you could add to mouse.x or mouse.y, but I can't seem to find them anywhere in the help section. Do scrolling variables exist, or is there another way to get mouse screen coordinates?
Title: Re: Getting mouse room coordinates
Post by: TerranRich on Thu 01/07/2004 04:09:47
Search for viewport x and y values.
Title: Re: Getting mouse room coordinates
Post by: Scorpiorus on Sat 03/07/2004 10:55:16
Yep, mouse.x/y are always relative to the current viewport position.

To get the room coordinates do as Moebius 5.18 said:

int roomX = GetViewportX() + mouse.x;
int roomY = GetViewportY() + mouse.y;
Title: Re: Getting mouse room coordinates
Post by: jamesreg on Sun 13/12/2009 21:57:38
I am doing a scrolling background screen

I will be using a gui which is the size of the regular screen size so that when scrolling the screen the gui stays in place

I am trying to figure out how to implement something simular to whats shown in this example in the post

I need to be moving the mouse around on screen and have the coordinates for the scrolling screen display in my gui.

I need to know step by step instructions of how to do this