Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Size

Size containing width and height

Hierarchy

  • Size

Implements

Index

Constructors

constructor

  • new Size(width: number, height: number): Size
  • Creates a Size object from the given width and height (floats).

    Parameters

    • width: number

      width of the new size

    • height: number

      height of the new size

    Returns Size

Properties

heightSearch playground for height

height: number

Height

widthSearch playground for width

width: number

Width

Accessors

surface

  • get surface(): number
  • The surface of the Size : width * height (float).

    Returns number

Methods

addSearch playground for add

  • Sums the width and height of two sizes

    Parameters

    • otherSize: Size

      size to add to this size

    Returns Size

    a new Size set as the addition result of the current Size and the given one.

cloneSearch playground for clone

  • Clones the size

    Returns Size

    a new Size copied from the given one.

copyFromSearch playground for copyFrom

  • copyFrom(src: Size): void
  • Updates the current size from the given one.

    Parameters

    • src: Size

      the given size

    Returns void

copyFromFloatsSearch playground for copyFromFloats

  • copyFromFloats(width: number, height: number): Size
  • Updates in place the current Size from the given floats.

    Parameters

    • width: number

      width of the new size

    • height: number

      height of the new size

    Returns Size

    the updated Size.

equalsSearch playground for equals

  • equals(other: Size): boolean
  • True if the current Size and the given one width and height are strictly equal.

    Parameters

    • other: Size

      the other size to compare against

    Returns boolean

    True if the current Size and the given one width and height are strictly equal.

getClassNameSearch playground for getClassName

  • getClassName(): string
  • "Size"

    Returns string

    the string "Size"

getHashCodeSearch playground for getHashCode

  • getHashCode(): number
  • Returns the Size hash code.

    Returns number

    a hash code for a unique width and height

multiplyByFloatsSearch playground for multiplyByFloats

  • multiplyByFloats(w: number, h: number): Size
  • Multiplies the width and height by numbers

    Parameters

    • w: number

      factor to multiple the width by

    • h: number

      factor to multiple the height by

    Returns Size

    a new Size set with the multiplication result of the current Size and the given floats.

setSearch playground for set

  • set(width: number, height: number): Size
  • Updates in place the current Size from the given floats.

    Parameters

    • width: number

      width to set

    • height: number

      height to set

    Returns Size

    the updated Size.

subtractSearch playground for subtract

  • Subtracts the width and height of two

    Parameters

    • otherSize: Size

      size to subtract to this size

    Returns Size

    a new Size set as the subtraction result of the given one from the current Size.

toStringSearch playground for toString

  • toString(): string
  • Returns a string with the Size width and height

    Returns string

    a string with the Size width and height

Static LerpSearch playground for Lerp

  • Creates a new Size set at the linear interpolation "amount" between "start" and "end"

    Parameters

    • start: Size

      starting size to lerp between

    • end: Size

      end size to lerp between

    • amount: number

      amount to lerp between the start and end values

    Returns Size

    a new Size set at the linear interpolation "amount" between "start" and "end"

Static ZeroSearch playground for Zero

  • Create a new size of zero

    Returns Size

    a new Size set to (0.0, 0.0)

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method