Changing mouse cursor in GUI

Started by CharlieTheChuck, Sun 25/05/2003 18:02:45

Previous topic - Next topic

CharlieTheChuck

 >:( I've created a new GUI which is a shop buying screen. It starts when a dialog calls a script turning the GUI on. Problem is the mouse cursor is still the talking one. I want to change to the pointer I've tried adding SetMouseCursor(6) before the GUI is turned on but it doesn't work.

Ishmael

Is the GUIOn() in the dialog_reguest? (are you using that function?) Have you tried putting it after the GUIOn()?
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

CharlieTheChuck

Yes I'm usin a dialog_request I've tried GUIon before and after the setmousecursor but either way the cursor stays as the talking one.

Scorpiorus

Did you finish the dialog after the run-script command? (stop I mean)

-Cheers

CharlieTheChuck

I remembered to put a stop in after the run-dialog command, so it's something else. I'm thinking of changing mouse cursor before i run the dialog, then changing it again afterwards. that should work ( i think)  

Scorpiorus

I just have a test and figured out the next:
When you start the dialog (using RunDialog() or through the interaction editor) AGS saves the current cursor mode and changes it to the arrow.
And when the dialog was finished it restores previously saved mode.

You place it inside dialog_request(), right? But when the dialog_request() is running the dialog itself hasn't ended actually. It will be just after dialog_request() has finished executing. Therefore it overrides the mode was set. (with MODE_TALK in your case):

Sequence:
==========
1. Run the dialog and save current mode (MODE_TALK)
2. On choose option run dialog_request()
3. SetCursorMode(MODE_"ARROW"); dialog is still running
4. GUIOn(...)
5. Ruturn from dialog_request(); dialog is still running
6. End dialog on stop command and restore saved mode
So we have MODE_TALK instead.

Quote'm thinking of changing mouse cursor before i run the dialog, then changing it again afterwards. that should work ( i think)
Yes, that is. Also you can set the mode just after the dialog has ended:

dialog script:
@2
run-script 1
stop


Global script:

int TimeForShopping = 0;
function dialog_request (int value) {

if (value == 1) {
   TimeForShopping = 1;
}

}


function repeatedly_execute() {

 if (TimeForShopping == 1) {
       SetMouseCursor(6);
       GUIOn(...);
       TimeForShopping = 0;
 }

}

-Cheers

CharlieTheChuck

Thanks for you help, I understand how it works now. The only problems I got now is trying to draw the characters  ;)

SMF spam blocked by CleanTalk