change cursor graphic for short period of time

Started by Alen101, Fri 04/03/2016 23:13:01

Previous topic - Next topic

Alen101

Is there a not compicated way to make my cursor change for a second and then to comeback to my original cursor image?
my mouse is an aim and i am shooting,
I have an aim draw on the cursor and i want to add a spark when i shoot (when i press the mouse button)
ive been looking at the posts, but it gets far too complicated to the point i am now at scripting.

Any help wold be great!
Thanks!!!

Slasher

assuming its an inv item used for the crossfire (or whatever)

eg
Code: ags
mouse.ChangeModeGraphic(4, 2057); // number of cursor mode (4= Use inv) and graphic to use. Then just switch back afterwards.


something like this...


Khris

Or use the actual name:

Code: ags
  mouse.ChangeModeGraphic(eModeUseinv, 2057);
  // or
  mouse.ChangeModeGraphic(mouse.Mode, 2057); // change current mode's graphic


Then call Wait(3) which will show the changed cursor for 3/40th of a second. Then change it back.
You can also set a timer and change it back in repeatedly_execute.

Vincent

I think you can do it in several ways..
For example, let's say that the pointer is an object.

Code: ags

function repeatedly_execute()
{
  if (Object.GetAtScreenXY(211, 145) == oRock) // and mouse button is pressed
  {
    mouse.SaveCursorUntilItLeaves();
    mouse.Mode = eModeTalk;
  }
}


I think that Mouse.SaveCursorUntilItLeaves() maybe it could be useful in this case..
This allows you to temporarily change the mouse cursor when the mouse moves over a hotspot, object or character and have it automatically change back to the old cursor when the player moves the mouse away.


SMF spam blocked by CleanTalk