Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Wed 24/03/2004 02:55:33

Title: Mouseclick question
Post by: on Wed 24/03/2004 02:55:33
I'm trying to set up an interface where left clicking walks/interacts and right clicking looks. I tried tweaking the mouse function but I'm not having any luck:

Quotefunction on_mouse_click(int button) {
 // called when a mouse button is clicked. button is either LEFT or RIGHT
 if (IsGamePaused() == 1) {
   // Game is paused, so do nothing (ie. don't allow mouse click)
 }
 else if (button==LEFT) {
   ProcessClick(mouse.x, mouse.y, SetCursorMode(MODE_USE));
   if (GetLocationType(mouse.x,mouse.y)==0) //cursor not over hotspot/character/object
   SetCursorMode (MODE_WALK);
 }
 else {   // right-click, look
   ProcessClick(mouse.x, mouse.y, SetCursorMode(MODE_LOOK));
 }
}

This changes the cursor appropriately but doesn't use it. Is there a command I'm overlooking here? Thanks in advance for any help.
Title: Re:Mouseclick question
Post by: on Wed 24/03/2004 03:09:01
Wow, after puzzling over that for a day I find out how to fix it all of ten minutes after I post. Don't I feel stupid. Feel free to delete this topic.
Title: Re:Mouseclick question
Post by: TerranRich on Wed 24/03/2004 05:41:57
Quick contest! Who can guess why it didn't work properly? I think I can figure it out. :)
Title: Re:Mouseclick question
Post by: Ishmael on Thu 25/03/2004 20:04:34
I know what is it...

Something to do with:

SetCursorMode (MODE_WALK);


;D