Disabling the pointer cursor on GUIs

Started by Scoville, Tue 10/05/2005 19:07:18

Previous topic - Next topic

Scoville

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.

Scummbuddy

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.
- Oh great, I'm stuck in colonial times, tentacles are taking over the world, and now the toilets backing up.
- No, I mean it's really STUCK. Like adventure-game stuck.
-Hoagie from DOTT

Scoville

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.

monkey0506

You could try something like:

Code: ags
/* 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.

Ashen

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:
Code: ags

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.)
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk