Novelty scripting reference > Scripted events > OnMouseRelease

OnMouseRelease

This event is triggered when a mouse button is released.

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.

MouseButton mouseButton
Button that was clicked.

float mouseX
Horizontal cursor position.

float mouseY
Vertical cursor position.


Sample

event Sample.OnMouseRelease
{
	// Get scene coordinate where button was released  
	Vector2 Point = TransformToSceneCoord(mouseX, mouseY);
	Print(Point.AsString());

	// Print the name of the button that was released  
	switch (mouseButton)
	{
	case MB_LEFT:
		Print("Left button");
		break;
	case MB_MIDDLE:
		Print("Middle button");
		break;
	case MB_RIGHT:
		Print("Right button");
		break;
	}
}

Back to top