Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Scoville on Tue 10/05/2005 19:07:18

Title: Disabling the pointer cursor on GUIs
Post by: Scoville on Tue 10/05/2005 19:07:18
By default AGS switches the mouse over to the pointer cursor when you bring up a popup GUI at the top of the screen. How can I change this so the mouse stays on the current cursor. I tried disabling cursor mode 6 on start up of the game, but that doesn't work.
Title: Re: Disabling the pointer cursor on GUIs
Post by: Scummbuddy on Tue 10/05/2005 20:06:26
you could do several things. you could add in the code, that when this gui is opened, you can changecursorgraphic to be one that you want, or you could just go ahead and change the cursor graphic in the editor, or, when the GUI to pop up is called, setcursormode right away.
Title: Re: Disabling the pointer cursor on GUIs
Post by: Scoville on Tue 10/05/2005 21:30:39
My problem is that I do not know how to code something to happen when the GUI opens. The default global script includes a interface_click function, but no interface open function.
Title: Re: Disabling the pointer cursor on GUIs
Post by: on Wed 11/05/2005 12:27:53
You could try something like:

/* in repeatedly_execute_always */
if ((gGuiname.Visible) && (mouse.Mode != eMode****)) mouse.Mode = eMode****;
else if (gGuiname.Visible == false) mouse.UseDefaultGraphic();


In AGS 2.7, but then I'm not sure this is even right...I'm kind of tired -- and off to school.  10 days left after today.  I am so friggin' happy.
Title: Re: Disabling the pointer cursor on GUIs
Post by: Ashen on Wed 11/05/2005 13:10:19
Disabling mode 6 would have any effect, since it doesn't actually change the cursor mode, it just uses it's graphic. Try something like this, in repeatedly_execute:

if (IsGUIOn (ICONBAR)) SetDefaultCursor(); // replace ICONBAR with the name of your GUI

NOTE: you may get a slight flicker, as the cursor changes to the pointer, then changes back.
(This is for 2.62, obviously, but looking up the commands should give you the 2.7 versions, if you need them.)