Animation of cursor when over a hotspot?

Started by debudding, Sat 15/05/2004 10:33:20

Previous topic - Next topic

debudding

I wanted to know if there is any way that i can have an animated cursor when over certain hotspots,

for example i have a hotspot over a door in one room, a have a animated cursor with an open door and a little arrow that moves in and out in veiw 5,
how do i get the animation to run just when the cursor is over the hotspot and to stop when the cursor is off the hotspot?

many thanks dan

Pumaman

Currently you have to do it the hard way by using ChangeCursorGraphic to manually animate the cursor. On my to-do list is a Start/StopCursorAnimating command so that you can easily start and stop the animation whenever you want.

..

Depending on which way you want it done...

For either of these ways you need a new cursor mode (Curosrs>New Cursor) With the Animate and When over hotspot/object is selected and set the view up and everything with the open door.

If you want it so when the mouse hovers over the door it changes the cursor (broken Sword Style)
In Mouse over hotspot put a script with
SetCursorMode(int newmodenumber);

Then with anyclick on hotspot you can put in your script for whatever you want to happen.


If you have an interface where the player can chose their current curosr mode (Walk, Talk etc) And you for example only wanted it to animate over the door when the INTERACT was the current mode you could put this in
Mouse Moves over Hotspot

if (GetCursorMode() == 2)
   {
SetCursorMode(intnewmodenumber);
}

And then in anyclick on hotspot

if (GetCursorMode() == 10)
   {
WHATEVER YOU WANT TO HAPPEN WHEN THE PLAYER INTERACTS WITH DOOR
}

If you need any  further explanation just ask. Or if i am completely wrong correct me.

Pumaman

Actually that's a good idea, I didn't think of that. Yeah, just create a new cursor with the view set to animate, and then use SetMouseCursor to change to it when they move the mouse over the hotspot.

debudding

i used one of the user cursors and drew a new sprite for it the first one in the short animation of the door cursor.
i then ticked the box "animate using" and put veiw 5 as that is the animation.
i also ticked the "only when over hotspot or object box"

i named the new cursor "Door" and it is cursor number 8

i got as far as the

// room script file

function hotspot1_a() {
  // script for hotspot1: Mouse moves over hotspot
SetCursorMode( WHAT GOES IN HERE? ) 
}

im not sure what to put in the brackets,

and yes i did want the brocken sword style, man the game rocks, i appologise for my ignorance but please help.

many thanks dan


..

function hotspot1_a() {
  // script for hotspot1: Mouse moves over hotspot
SetCursorMode(8); 
}

Thats all. It sets the cursor to mode 8 (The mode you created)

debudding

Man that kicks bootai!

is there any way to make it stop when i move the cursor of the hotspot or am im gonna have to put up with that,

ans yes im gonna do that with every cursor , i got the big picture man, we got blinking eyes, and pintching fingers wow!,

cheers

strazer

But please keep the Start- and StopCursorAnimating commands in the list. :)

Edit: debudding, what about the SaveCursorForLocationChange function?

..

Well this is the long way, I've just told Debugging on MSN how to do this but will post it here as well for neone who wants to know, In my game i just screate a small hotspot around the other hotpost that changes the mode back again.

Pumaman

Yeah, the easiest way is to just do:

SaveCursorForLocationChange();
SetMouseCursor(8);

(the former command is only aviilable in v2.61, however)

..

When I searched for SaveCursorForLocationChange(); nothing happened? Is it in the Manual yet?

Darth Mandarb

#11
Here is a thread I started back in January asking something similar.  It doesn't deal with animation of the cursor ... but how to get back to the cursor mode you were on before the change.

Cursor Mode Variable

Sounds to me like the SaveCursorForLocationChange(); does this same thing ... but I haven't played with it yet.

Hope it was some help!

Scorpiorus

Quote from: Scuthbert on Sat 15/05/2004 15:37:40
When I searched for SaveCursorForLocationChange(); nothing happened? Is it in the Manual yet?
Afaik, it was implemented after the official 2.6 SP1. So, expect it in the next official 2.61. :)

SMF spam blocked by CleanTalk