Class: Size

Size

Represents a size.

new Size(width, height) [source]

Parameter Type Description
width Number width value
height Number height value

Members

  • width

  • Properties:
    Name Type Description
    width Number width
    Source:

  • height

  • Properties:
    Name Type Description
    height Number height
    Source:

    Methods

  • copy() [source]

  • Returns a copy of the size
    Returns:
    Size: copy
  • add(size) [source]

  • Returns the result of addition of another size.
    Parameter Type Description
    size Size size to add
    Returns:
    Size: result
  • equals(size) [source]

  • Compare with another size to see whether they are equal.
    Parameter Type Description
    size Size size to compare
    Returns:
    Boolean:
  • multi(ratio) [source]

  • Returns the result of multiplication of the current size by the given number.
    Parameter Type Description
    ratio Number ratio to multi
    Returns:
    Size: result
  • toPoint() [source]

  • Converts the size object to a [Point]{Point}
    Returns:
    Point: point
  • toArray() [source]

  • Converts the size object to an array [width, height]
    Returns:
    Array.<Number>:
  • toJSON() [source]

  • Convert the size object to a json object {width : .., height : ..}
    Returns:
    Object: json