navigation mode in gui?

Started by beaver, Fri 16/04/2004 22:06:40

Previous topic - Next topic

beaver

Hi all, This is my first post here.

How would i display the current navigation mode (walk, look at etc) in a set location on the gui/screen rather than have it change the icon itself?

for example; when u switch between the navigation modes using right click the icon changes to the mode you are on, like if you are on walk mode it shows feet, and look at is an eye. how would i have it do that? but instead of it changing the icon it shows the current mode on the gui.
I looked in the manual and have browsed around the forums and not had any luck.
any help would be great, thanks.

Bryan

#1
Hi and welcome!  I'm pretty new here too, they're reasonably nice folk ;)

Here is what I would start out with, (like I said I'm new... so someone may come along and tell us this is not a good approach).

You can change the cursor for each mode to the same graphic, see ChangeCursorGraphic in the manual.  Then, let's assume that you've got a gui named MYGUI, and use a button in there which is the current mode icon.

Then:
The right-click mode cycling is done in on_mouse_click (see Script->Edit Global Script).
In there, you'll see (assuming you've got the default function), that if it's the LEFT
button, it processes the click, otherwise, it does SetNextCursorMode().

After the SetNextCursorMode() call, you can put something like:
Code: ags

int mode = GetCursorMode();
if (mode == MODE_WALK) 
   SetButtonPic(MYGUI, MODEBUTTON, 1, WALKSPRITE);
if (mode == MODE_LOOK) 
   SetButtonPic(MYGUI, MODEBUTTON, 1, LOOKSPRITE);
etc....

MODEBUTTON and WALKSPRITE etc are the corresponding integers you set up.

I hope that made sense.

I think the above will do, but like I said, it's just a starting point.  You should check out the manual about SetButtonPic to make sure the button behaves like you want (ie, not like a button).  I don't know how to do it other than a button though.
this space intentionally left blank

SMF spam blocked by CleanTalk