IsInside

Syntax

Mouse:IsInside(Number x, Number y, Number width, Number height, Boolean return)

Description

Determines if the mouse location is inside a rectangle.

Number x - an X coordinate on the screen.

Number y - a Y coordinate on the screen.

Number width - width of the rectangle starting from X location.

Number height - height of the rectangle starting from Y location.

Boolean return - will contain value whether mouse location is inside the specified rectangle coordinates.

Note

It's better to use Mouse:OnImage if trying to check mouse location against an image location.

Example

Var:Boolean onImage;
 
function main() {
  //nothing to initialize
}
function cleanrender() {
  if (isInside == true) {
    Screen:PrintString("mouse is in rectangle")
  }
}
function mousemove() {
  Mouse:IsInside(50, 50, 50, 50, isInside)
}
www.konsolscript.org
© 2005-2011 KonsolScript Labs | All Rights Reversed | Licensed under GNU GPL | Designed by Mj Mendoza IV
http://www.sourceforge.net