Size

Size containing widht and height

Hierarchy

  • Size

Implements

Index

Constructors

constructor

Find examples in Playground
  • 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

height

Find examples in Playground
height: number

Height

surface

Find examples in Playground
surface: number

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

width

Find examples in Playground
width: number

Width

Methods

add

Find examples in Playground
  • 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.

clone

Find examples in Playground
  • Clones the size

    Returns Size

    a new Size copied from the given one.

copyFrom

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

    Parameters

    • src: Size

      the given size

    Returns void

copyFromFloats

Find examples in Playground
  • 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.

equals

Find examples in Playground
  • 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.

getClassName

Find examples in Playground
  • getClassName(): string
  • "Size"

    Returns string

    the string "Size"

getHashCode

Find examples in Playground
  • getHashCode(): number
  • Returns the Size hash code.

    Returns number

    a hash code for a unique width and height

multiplyByFloats

Find examples in Playground
  • 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.

set

Find examples in Playground
  • 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.

subtract

Find examples in Playground
  • 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.

toString

Find examples in Playground
  • toString(): string
  • Returns a string with the Size width and height

    Returns string

    a string with the Size width and height

Static Lerp

Find examples in Playground
  • 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 Zero

Find examples in Playground
  • Create a new size of zero

    Returns Size

    a new Size set to (0.0, 0.0)

Generated using TypeDoc