I want the exact room coordinates where a mouseclick happens and mouse.x for example only gives me the screen coordinates and not the room coordinates. What do I use? GetAtRoomXY doesn't help as it just tell what is there but doesn't give the coordinates.
I think checkout
GetViewportX() and GetViewportY()
barefoot
with (GetViewportX()+mouse.x) it works, thanks barefoot :)
strange that there is no native expression for this...
Well you could write some custom functions pretty easily:
int RoomXToScreenX(int x)
{
return (x - GetViewportX());
}
int RoomYToScreenY(int y)
{
return (y - GetViewportY());
}
int ScreenXToRoomX(int x)
{
return (x + GetViewportX());
}
int ScreenYToRoomY(int y)
{
return (y + GetViewportY());
}