Manhunter style GUI

Started by nok, Sat 06/03/2004 15:13:10

Previous topic - Next topic

nok

ok im going for a manhunter type first person interface as my first project with AGS.  
having some problems with the cursors. how do i change an animating cursor when mouse  over a hotspot.
what im aiming for is the manhunter navigation, an arrow pointing left when mouseover left exit, pointing down when going back,  and turning into an eye for hotspots that only are scenery etc. anyone know how to go about this?

rtf

#1
EDIT:  Aww crap, I misunderstood your question.  Sorry   Hehehe  ::)  



The cursor thing isn't too hard.

Make each frame of your animated cursor, and import them all to the AGS editor.

Make a new view in the view editor.

Go to cursors, change the look of the default cursor in whatever interaction you want.  Click "animate"  using whatever view number you made. Then click "cursor over hotspot" or whatever it is.  

Good luck on your first project!

I fail at art.

Scorpiorus

at the top of the script:
int prev_hotspot=-1;

in repeatedly execute:

int cur_hotspot = GetHotspotAt (mouse.x, mouse.y);
if (prev_hotspot!=cur_hotspot) {

   if (cur_hotspot == 0) SetMouseCursor(...);
   if (cur_hotspot == 1) SetMouseCursor(...);
   if (cur_hotspot == 2) SetMouseCursor(...);
   if (cur_hotspot == 3) SetMouseCursor(...);
   prev_hotspot = cur_hotspot;
}


nok

thanks guys, got the cursors working. had to do a new view for each direction, then used SetCursorMode(); and SetMouseCursor();  on each hot spot.  only problem then was that the mouse didnt change back when it left the hotspot. so i checked the bb and found a solution; creating a large hotspot that covered the rest of the screen. works fine except that its now kind of annoying to work with the hotspots since i no longer can see the background..  is there a way around this?
might try that script scorpiorus, hotspot 0, is that "no hotspot"?

Scorpiorus

#4
Quotemight try that script scorpiorus, hotspot 0, is that "no hotspot"?
Yep, exactly! So, you can have:

int cur_hotspot = GetHotspotAt (mouse.x, mouse.y);
if (prev_hotspot!=cur_hotspot) {

  if (cur_hotspot == 0) SetDefaultCursor();
  if (cur_hotspot == 1) SetMouseCursor(...);
  if (cur_hotspot == 2) SetMouseCursor(...);
  if (cur_hotspot == 3) SetMouseCursor(...);
  prev_hotspot = cur_hotspot;
}

to restore the default cursor view


EDIT:

btw, in the next version of AGS there will be a function to easily implement that kind of things:

QuoteSaveCursorForLocationChange()

Saves the current mouse cursor, and restores it when the mouse leaves the current hotspot, object or character.
This allows you to temporarily change the mouse cursor when the mouse moves over a hotspot, and have it automatically change back to the old cursor when the player moves the mouse away.

NOTE: You must call this BEFORE you change to your new temporary cursor, or the new cursor will be saved by this command.

Example:

SaveCursorForLocationChange();
SetCursorMode(MODE_TALK);

will change the cursor mode to Talk for as long as the mouse is over the current object
It's now at the beta stage: http://www.agsforums.com/yabb/index.php?board=2;action=display;threadid=12051

nok

thanks for the help Scorpiorus!
looking forward to that next release, any ETA?

Scorpiorus

#6
There are no certain release date CJ sets, so a common answer is just after it'll have been done. :)

SMF spam blocked by CleanTalk