Repository

Rect

Constructor Summary

Public Constructor
public

Rect hold a simple rectangle representation with x & y coordinates and width & height.

Member Summary

Public Members
public

height: *

public

width: *

public

x: *

public

y: *

Method Summary

Public Methods
public

fromArray(array: Array)

Sets the rect's value based on an array formatted like [x, y, width, height]

public

Return an array representation

Public Constructors

public constructor(params: Object) source

Rect hold a simple rectangle representation with x & y coordinates and width & height.

Params:

NameTypeAttributeDescription
paramsObject

Parameters object, given by the constructor.

params.xfloat
  • optional
  • default: 0
params.yfloat
  • optional
  • default: 0
params.widthfloat
  • optional
  • default: 1
params.heightfloat
  • optional
  • default: 1

Public Members

public height: * source

public width: * source

public x: * source

public y: * source

Public Methods

public fromArray(array: Array) source

Sets the rect's value based on an array formatted like [x, y, width, height]

Params:

NameTypeAttributeDescription
arrayArray

[x, y, width, height]

public toArray(): Array source

Return an array representation

Return:

Array

[x, y, width, height]