Next generation modular control surface
TouchOSC Manual

Script · Objects · Rectangle

A rectangle object native to TouchOSC. Will be returned and can be passed anywhere a rectangle is required.



The x position of the rectangle.


The y position of the rectangle.


The width of the rectangle.


The height of the rectangle.


Constructor functions

Rectangle()                               -- [1]
Rectangle(rectangle)                      -- [2]
Rectangle(number, number)                 -- [3]
Rectangle(number, number, number, number) -- [4]

Returns a new rectangle with

  1. position and size set to (0,0).
  2. position and size copied from another Rectangle object.
  3. position set to (0,0) and size set to the two numbers.
  4. position set to the first pair of numbers and size set to the second two numbers.



rectangle:contains(number, number)

Tests if the point at position (number, number) is contained within the rectangle and returns a boolean value. uses cookies to deliver website content. By continuing without changing your preferences, you agree to our use of cookies.