Mioplanet Documentation Center
Resources and Help
HomeProductsMioScriptJavaScriptTechNotesPHP
   Home | MioScript | num.isInRect SEARCH    

  Functions
num.abs
num.blue
num.char
num.colorToHex
num.compute
num.cos
num.fromHex
num.getAngle
num.getDistance
num.green
num.hexToColor
num.isInRect
num.not
num.random
num.red
num.rgb
num.sin
num.toHex

  MioScript Reference
> Statements
app...
browser...
dialog...
disk...
draw...
extern...
filename...
keyboard...
menu...
mio...
mouse...
num...
path...
pushButton...
reg...
RS232...
sci...
screen...
shortcut...
sound...
str...
system...
time...
var...
window...

Function
num.isInRect

Language: MioScript
Product: MioFactory


Syntax

num.isInRect(px,py, x,y, w,h)


Parameters

INTpx,pyCoordinates of the first point.
INTx,yCoordinates of the upper-left corner of a rectangle.
INTw,hSize of the rectangle.


Return value

Number



Description

Returns true if a point (px, py) is included in a rectangle (x, y, w, h).

This function is generally used to check if the mouse is in a rectangle.

Note: This function is defined in the library klib.k and is linked automatically.




MioScript Sample Code

// To something when the user clicks inside a rectangle.

event.mouse:click
    &mx = mouse.main.x()
    &my = mouse.main.y()
    if(num.isInRect(&mx, &my, 10,10,20,20))
        ...
    if.end
event.end