Lysa  0.0
Lysa 3D Engine
Rect Class Referenceabstract

Detailed Description

An axis-aligned 2-D rectangle defined by position and size.

Lua full name: lysa.Rect

Public Member Functions

boolean contains (x: number, y: number)
 Returns true if the given point is inside this rect. More...
 
boolean contains (rect: Rect)
 Returns true if the given rect is fully inside this rect. More...
 
nil intersect (a: Rect, b: Rect)
 Sets this rect to the intersection of a and b. More...
 

Properties

number x
 Constructor: Rect() Rect(x, y, width, height)
 
number y
 Bottom edge Y position in screen/virtual space.
 
number width
 Width of the rectangle.
 
number height
 Height of the rectangle.
 

Member Function Documentation

boolean contains ( number  x,
number  y)

Returns true if the given point is inside this rect.

Parameters
xnumber
ynumber
Returns
boolean
boolean contains ( Rect  rect)

Returns true if the given rect is fully inside this rect.

Parameters
rectRect
Returns
boolean
nil intersect ( Rect  a,
Rect  b)

Sets this rect to the intersection of a and b.

Parameters
aRect
bRect

Property Documentation

number x

Constructor: Rect() Rect(x, y, width, height)

number y

Bottom edge Y position in screen/virtual space.

number width

Width of the rectangle.

number height

Height of the rectangle.