interface ResizeMode {
    clipX?: number;
    clipY?: number;
    h: number;
    type: "cover" | "contain";
    w: number;
}

Properties

Properties

clipX?: number

X-Axis clip factor

This can be any floating point number between 0.0 and 1.0.

Examples

  • 0.0 = Clips the left of the texture, showing the entire right.
  • 0.5 (default) = Clips the left and right off equally.
  • 1.0 = Clips the right of the texture, showing the entire left.

Note: This property is only valid for the "cover" resize mode.

See Clipping - ResizeMode for more information.

0.5

clipY?: number

Y-Axis clip factor

This can be any floating point number between 0.0 and 1.0.

Examples

  • 0.0 = Clips the top of the texture, showing the entire bottom.
  • 0.5 (default) = Clips the top and bottom off equally.
  • 1.0 = Clips the bottom of the texture, showing the entire top.

Note: This property is only valid for the "cover" resize mode.

See Clipping - ResizeMode for more information.

0.5

h: number

Height of rectangular area (in pixels)

See Clipping - ResizeMode for more information.

type: "cover" | "contain"

Resize mode to use

Options

  • "cover"
    • Ensure that the texture covers the entire rectangular area defined by w and h.
      • clipX and clipY can be used to adjust how the texture is clipped into the rectangle.
  • "contain"
    • Fits an image into the rectangular area defined by w and h.

See Clipping - ResizeMode for more information.

w: number

Width of rectangular area (in pixels)

See Clipping - ResizeMode for more information.