(Solved)Check if any object that the mouse is over is animating.

Started by FanOfHumor, Wed 06/04/2022 06:09:35

Previous topic - Next topic

FanOfHumor

I would like to be able to have a small script to change the cursor to normal whenever its over any object and the object is animating.If it isn't animating to then change the mouse mode to whatever I choose.
This is the script I use to change it whenever it's animating. This is in a rooms repeatedly execute function.
Code: ags
	
if(Hotspot.GetAtRoomXY(mouse.x, mouse.y)==hHotspot1)
	{
			if(fries2.Animating||fries.Animating)
		{ 
			mouse.Mode=eModeWalkto;
		}
		else
		{
			mouse.SaveCursorUntilItLeaves();
			mouse.Mode=eModeclickable;
		}  
	}

What I would like to do is to check if any object is animating+mouse is on it.
What I have tried is this in Global Script in repeatedly execute always. I stopped short because I couldn't think of anything that could possibly work.
Code: ags

  if (GetLocationType(mouse.x, mouse.y) == eLocationCharacter||GetLocationType(mouse.x, mouse.y) == eLocationObject && \\I thought maybe something here to set the condition of animating.)
  {
     if(__//any object that the mouse is over__.animating==true)
     {
        mouse.SaveCursorUntilItLeaves();
        mouse.Mode=eModeclickable;
     }
  }


So basically it should check what object the mouse is on and then check if that object is animating.

EDIT:

If no one knows please say so.

Matti

Something like this should work:

Code: ags
     Object *o = Object.GetAtScreenXY(mouse.x, mouse.y);
     if (o != null && o.Animating) // do something


Quote from: Pajama Sam
If no one knows please say so.

What is that supposed to mean? Should everyone who doesn't know the answer post here to say they don't know the answer?  :-D

Khris

Usually, if you don't receive a fast answer, the question is either very hard/involved or very easy. I tend to skip both of these until I'm really bored.

FanOfHumor

Thanks for the answer.

QuoteWhat is that supposed to mean? Should everyone who doesn't know the answer post here to say they don't know the answer?  :-D
Of course not. (laugh)

SMF spam blocked by CleanTalk