Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Hans on Fri 19/01/2007 22:56:14

Title: Character face clicked point (SOLVED)
Post by: Hans on Fri 19/01/2007 22:56:14
I have a very big hotspot and I want my character to face the point where you clicked on it. Is there a way to use the clicked place's coordinates as the coordinates that have to be faced?
Title: Re: Character face clicked point
Post by: monkey0506 on Fri 19/01/2007 23:02:11
// Any click on hotspot
player.FaceLocation(mouse.x, mouse.y);
Title: Re: Character face clicked point
Post by: Hans on Fri 19/01/2007 23:03:14
I knew it was simple!
Thank you!
Title: Re: Character face clicked point (SOLVED)
Post by: monkey0506 on Fri 19/01/2007 23:06:39
Seeing as you've declared this solved, I presume you actually tested it?

Glad to have been of assistance.
Title: Re: Character face clicked point (SOLVED)
Post by: Hans on Sat 20/01/2007 06:58:11
Yes. I did test it. But I don't even think that that was necessary. Your hint was very "I-am-gonna-work"-looking. ;)
Thank again.
Title: Re: Character face clicked point (SOLVED)
Post by: Ashen on Sat 20/01/2007 12:07:52
This is a clear case of 'READ THE MANUAL'. One thing that's not explicitly in the manual or monkey's post, however, is that that won't work properly for scrolling rooms. Mouse coords are Screen based, FaceLocation is Room based; so for scrolling rooms you'd need to use:

// Any click on hotspot
player.FaceLocation(mouse.x+GetViewportX(), mouse.y+GetViewportY());