Problems with changing cursor graphic

Started by KristjanMan, Sat 25/03/2006 09:34:11

Previous topic - Next topic

KristjanMan

I'm using AGS v2.71

I have a problem with my GUIs. On my GUI1 I have a button that opens GUI2 (inventory) On the GUI2 i have button that should close GUI2, but i don't know how to scrip it my GUI script looks like this at the moment
Code: ags
  {
gGui2.Visible = true;

Now how do i scrip it like that that the other button will close the GUI2?
- They are all from AGS coloringball

Ashen

Code: ags

gGui2.Visible = false;


Setting it to true would turn the GUI on.
I know what you're thinking ... Don't think that.

KristjanMan

#2
Thanks! I can't belive it was so obivius(did i spell that right?) You can now close this topic
- They are all from AGS coloringball

KristjanMan

Wel sense they haven't closed this thread i'll use this one I have a another problem
I used AGS about two years ago and then there was thing such as SetCursorMode but now its diffrent i checked the help of AGS but i can't understand it can you help
For example i would like that when i click on inventory item with intraction cursor the cursor would change to cursor (for example) sword
What would be the code for such thing?
- They are all from AGS coloringball

KristjanMan


This is what the error looks like what does "Not enogh parameters to call in function" mean anyway
this is what my code is like
Code: ags
if (mouse.Mode == eModeInteract) {
Ã,  mouse.ChangeModeGraphic (eModeSword);
}
else mouse.UseDefaultGraphic ();
- They are all from AGS coloringball

monkey0506

#5
Mouse.ChangeModeGraphic takes two parameters, (CursorMode) mode, and (int) slot, and is used for permanent changes ("This permanently changes the specified mode's cursor graphic.").

Mouse.UseModeGraphic on the other hand, takes one parameter (CursorMode) mode and is used for temporary changes to be changed back with Mouse.UseDefaultGraphic ("Use this to restore the cursor picture after you changed it with the UseModeGraphic function.").

[EDIT:]

Oh, and BTW, "Not enough parameters in call to function" means just that:  you didn't put enough parameters in the function call, i.e., you supplied one parameter to a function expecting two.

When you get this error message, it is usually best to look up the function that is generating the error to make sure that (a) it is the function you intended to use and (b) you put the parameters in correctly (in the correct order).

KristjanMan

Oh this function only changes the graphics but i would need some like SetCursorMode witch won't work in 2.7
- They are all from AGS coloringball

nihilyst

When you open your AGS help by pressing F1 and are searching for SetCursorMode, you'll find the new way to do it.

cheers
nihilyst

monkey0506

Look up the Mouse.Mode property.

Set it like:  mouse.Mode = eModeInteract;

KristjanMan

Thanks guys! I found a way to make it work without errors
- They are all from AGS coloringball

A�rendyll (formerly Yurina)

mouse.mode can be used for your problem. Since I don't have a full code, I'd suggest opening the default (not empty) gametemplate and get the code from the e.g. look mode button. Easy as pie!

(and obvius needs to be obvious :P)
Yuna: Give me a Y!
Rikku: Give me an R!
Paine: Give me a break...
~Final Fantasy X-2

I've been

KristjanMan

Thanks i'll try that
- They are all from AGS coloringball

Ashen

#12
Try reading the manual. Looking up SetCursorMode would've pointed you to the entry for mouse.Mode (note the capital M for 'Mode').

For the example you gave, no coding is even required. By default, clicking an inventory item with the interact mode (eModeInteract) will set it as the active item - and unless you've changed the settings AGS should use the active item's graphic as the cursor. (The 'Don't use inventory graphics as cursors' shouldn't be checked.)

You might also want to look up some of the other Mouse functions and properties.

EDIT: Merged with other, similar thread.
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk