Class: Frame

rune.display.Frame(fxopt, fyopt, fwopt, fhopt, cxopt, cyopt, cwopt, chopt)

The Frame class is used to define the size and position of a display object at the time of rendering. Usually this item corresponds to the same size and position as the display item it represents, but there are exceptions.

Constructor

new Frame(fxopt, fyopt, fwopt, fhopt, cxopt, cyopt, cwopt, chopt)

Creates a new Frame object.
Parameters:
Name Type Attributes Default Description
fx number <optional>
0 Frame x.
fy number <optional>
0 Frame y.
fw number <optional>
0 Frame width.
fh number <optional>
0 Frame height.
cx number <optional>
0 Clipping x
cy number <optional>
0 Clipping y
cw number <optional>
0 Clipping width.
ch number <optional>
0 Clipping height.
Source:

Extends

Members

bottom :number

The sum of the y and height properties.
Type:
  • number
Inherited From:
Source:

bottomLeft :rune.geom.Rectangle

The location of the Rectangle object's bottom-left corner, determined by the values of the left and bottom properties.
Type:
Inherited From:
Source:

bottomRight :rune.geom.Rectangle

The location of the Rectangle object's bottom-right corner, determined by the values of the right and bottom properties.
Type:
Inherited From:
Source:

center :rune.geom.Point

The center point of the rectangle object.
Type:
Inherited From:
Source:

centerX :number

The x coordinate of the center of the object.
Type:
  • number
Inherited From:
Source:

centerY :number

The y coordinate of the center of the object.
Type:
  • number
Inherited From:
Source:

(readonly) clipping :rune.geom.Rectangle

Clipping data.
Type:
Source:

height :number

The height of the rectangle, in pixels.
Type:
  • number
Inherited From:
Source:

left :number

The x coordinate of the top-left corner of the rectangle.
Type:
  • number
Inherited From:
Source:
The sum of the x and width properties.
Type:
  • number
Inherited From:
Source:

size :rune.geom.Point

The size of the Rectangle object, expressed as a Point object with the values of the width and height properties.
Type:
Inherited From:
Source:

top :number

The y coordinate of the top-left corner of the rectangle.
Type:
  • number
Inherited From:
Source:

topLeft :rune.geom.Point

The location of the Rectangle object's top-left corner, determined by the x and y coordinates of the point.
Type:
Inherited From:
Source:

topRight :rune.geom.Point

The location of the Rectangle object's top-right corner, determined by the x and y coordinates of the point.
Type:
Inherited From:
Source:

width :number

The width of the rectangle, in pixels.
Type:
  • number
Inherited From:
Source:

x :number

The horizontal coordinate of the point. The default value is 0.
Type:
  • number
Inherited From:
Source:

y :number

The vertical coordinate of the point. The default value is 0.
Type:
  • number
Inherited From:
Source:

Methods

containsPoint(point) → {boolean}

Determines whether the specified point is contained within the rectangular region defined by this Rectangle object.
Parameters:
Name Type Description
point rune.geom.Point The point, as represented by its x and y coordinates.
Inherited From:
Source:
Returns:
A value of true if the Rectangle object contains the specified point; otherwise false.
Type
boolean

containsRectangle(rect) → {boolean}

Determines whether the Rectangle object specified by the rect parameter is contained within this Rectangle object. A Rectangle object is said to contain another if the second Rectangle object falls entirely within the boundaries of the first.
Parameters:
Name Type Description
rect rune.geom.Rectangle The Rectangle object being checked.
Inherited From:
Source:
Returns:
A value of true if the Rectangle object that you specify is contained by this Rectangle object; otherwise false.
Type
boolean

distance(point) → {number}

Returns the distance between the current and specified point.
Parameters:
Name Type Description
point rune.geom.Point The specified point.
Inherited From:
Source:
Returns:
Type
number

interpolate(point, fractionopt, outputopt) → {rune.geom.Point}

Determines a point between two specified points. The parameter fraction determines where the new interpolated point is located relative to the two end points.
Parameters:
Name Type Attributes Description
point rune.geom.Point The second point.
fraction number <optional>
The level of interpolation between the two points.
output rune.geom.Point <optional>
Save results to this object.
Inherited From:
Source:
Returns:
The new, interpolated point.
Type
rune.geom.Point

intersection(toIntersect, outputopt) → {rune.geom.Rectangle}

If the Rectangle object specified in the toIntersect parameter intersects with this Rectangle object, returns the area of intersection as a Rectangle object. If the rectangles do not intersect, this method returns an empty Rectangle object with its properties set to 0.
Parameters:
Name Type Attributes Description
toIntersect rune.geom.Rectangle The Rectangle object to compare against to see if it intersects with this Rectangle object.
output rune.geom.Rectangle <optional>
A Rectangle object to store the intersection results in.
Inherited From:
Source:
Returns:
A Rectangle object that equals the area of intersection.
Type
rune.geom.Rectangle

intersects(toIntersect) → {boolean}

Determines whether the object specified in the toIntersect parameter intersects with this Rectangle object.
Parameters:
Name Type Description
toIntersect rune.geom.Rectangle The Rectangle object to compare against this Rectangle object.
Inherited From:
Source:
Returns:
A value of true if the specified object intersects with this Rectangle object; otherwise false.
Type
boolean

toString() → {string}

Returns a string representation of the hitbox. Useful for troubleshooting.
Overrides:
Source:
Returns:
Type
string