Hi guys,
Forgive me if this is a stupid question - but is it possible to animate (non-blocking) an object when the mouse cursor passes over/on it? In the style of Quest for Glory IV character selection screen.
Any help much appreciated, thanks.
Shaun
Sure! Something like...
bool myObjectAlreadyAnimating=false;
function repeatedly_execute()
{
Object* mouseObject = Object.GetAtScreenXY(mouse.x, mouse.y);
if(mouseObject != null && mouseObject.ID == myObject.ID)
{
if(!myObjectAlreadyAnimating)
{
myObject.Animate(..,..); // Fill in the parameters here
myObjectAlreadyAnimating=true;
}
}
else if(myObjectAlreadyAnimating)
{
myObject.StopAnimating(); // Fill in parameters
myObjectAlreadyAnimating=false;
}
}
You could also use a Character instead of an Object, the methods are the same.
Thank you very much!!! :D