Home Reference Source
import {Rectangle} from './api/Rectangle.js'
public class | source

Rectangle

Represents a rectangle.

Static Method Summary

Static Public Methods
public static

tests(): dictionary

Return a list of tests to run for this class.

Constructor Summary

Public Constructor
public

constructor(x: number, y: number, width: number, height: number): *

Return a new Rectangle object for a given x,y, width and height.

Member Summary

Public Members
public

The height of the rectangle.

public

The width of the rectangle.

public

The x coordinate of the top-left corner of the rectangle.

public

The y coordinate of the top-left corner of the rectangle.

Method Summary

Public Methods
public

asCGRect(): CGRect

Return the Rectangle as a CGRect.

public

offset(x: number, y: number)

Adjust this rectangle by offsetting it.

public

Return a string description of the rectangle.

Static Public Methods

public static tests(): dictionary source

Return a list of tests to run for this class.

Return:

dictionary

A dictionary containing the tests to run. Each key is the name of a test, each value is a function which takes a Tester instance.

Public Constructors

public constructor(x: number, y: number, width: number, height: number): * source

Return a new Rectangle object for a given x,y, width and height.

Params:

NameTypeAttributeDescription
x number

The x coordinate of the top-left corner of the rectangle.

y number

The y coordinate of the top-left corner of the rectangle.

width number

The width of the rectangle.

height number

The height of the rectangle.

Return:

*

The new Rectangle object.

Public Members

public height: number source

The height of the rectangle.

public width: number source

The width of the rectangle.

public x: number source

The x coordinate of the top-left corner of the rectangle.

public y: number source

The y coordinate of the top-left corner of the rectangle.

Public Methods

public asCGRect(): CGRect source

Return the Rectangle as a CGRect.

Return:

CGRect

The rectangle.

public offset(x: number, y: number) source

Adjust this rectangle by offsetting it.

Params:

NameTypeAttributeDescription
x number

The x offset to apply.

y number

The y offset to apply.

public toString(): string source

Return a string description of the rectangle.

Return:

string

Description of the rectangle.

See something wrong or incomplete? Improve this page.