A rectangle object native to TouchOSC. Will be returned and can be passed anywhere a rectangle is required.
rectangle.x
The x position of the rectangle.
rectangle.y
The y position of the rectangle.
rectangle.w
The width of the rectangle.
rectangle.h
The height of the rectangle.
function Rectangle() -- [1]
function Rectangle(rectangle) -- [2]
function Rectangle(number, number) -- [3]
function Rectangle(number, number, number, number) -- [4]
Returns a new rectangle object with
(0,0)
.Rectangle
object.(0,0)
and size set to the two numbers.
function contains(number, number)
-- example
local r = Rectangle(10,10,50,50)
local b = r:contains(20,20)
print(b)
> true
Tests if the point at position (number, number)
is contained within the rectangle and returns a boolean
value.
We use cookies to deliver website content. By continuing without changing your preferences, you agree to our use of cookies.