Novelty scripting reference > Scripted events > OnMouseEnter

OnMouseEnter

This event is triggered when the mouse cursor passes into the bounding box of an object.

Remarks:

The mouse coordinates given are relative to the center of the scene. To make them relative to an object or the top left corner of scene use TransformToObjectCoord or TransformToSceneCoord respectively.


Implicit arguments

Object@ sender
Handle to an associated object; or null.

float mouseX
Horizontal cursor position.

float mouseY
Vertical cursor position.


Sample

event Sample.OnMouseEnter
{
	// Get relative point where cursor entered on the object   
	Vector2 Point = TransformToObjectCoord(sender, mouseX, mouseY);
	Print(Point.AsString());
}

Back to top