Home Reference Source
import {Resizer} from 'postprocessing'
public class | source

Resizer

A resizer that can be used to store a base and a target resolution.

The attached resizeable will be updated with the base resolution when the target resolution changes. The new calculated resolution can then be retrieved via Resizer.width and Resizer.height.

Static Member Summary

Static Public Members
public static get

An auto sizing constant.

Constructor Summary

Public Constructor
public

constructor(resizeable: Resizable, width: Number, height: Number, scale: Number)

Constructs a new resizer.

Member Summary

Public Members
public

base: Vector2

The base size.

public get

The calculated height.

public set

Sets the target height.

public

A resizable object.

public get

The current resolution scale.

public set

Sets the resolution scale.

public get

The calculated width.

public set

Sets the target width.

Static Public Members

public static get AUTO_SIZE: Number source

An auto sizing constant.

Can be used to automatically calculate the width or height based on the original aspect ratio.

Public Constructors

public constructor(resizeable: Resizable, width: Number, height: Number, scale: Number) source

Constructs a new resizer.

Params:

NameTypeAttributeDescription
resizeable Resizable

A resizable object.

width Number
  • optional
  • default: Resizer.AUTO_SIZE

The width.

height Number
  • optional
  • default: Resizer.AUTO_SIZE

The height.

scale Number
  • optional
  • default: 1.0

An alternative resolution scale.

Public Members

public base: Vector2 source

The base size.

This size will be passed to the resizable object every time the target width, height or scale is changed.

public get height: Number source

The calculated height.

If both the width and the height are set to Resizer.AUTO_SIZE, the base height will be returned.

public set height: Number source

Sets the target height.

Use Resizer.AUTO_SIZE to automatically calculate the height based on the width and the original aspect ratio.

public resizable: Resizable source

A resizable object.

public get scale: Number source

The current resolution scale.

public set scale: Number source

Sets the resolution scale.

Also sets the width and height to Resizer.AUTO_SIZE.

public get width: Number source

The calculated width.

If both the width and the height are set to Resizer.AUTO_SIZE, the base width will be returned.

public set width: Number source

Sets the target width.

Use Resizer.AUTO_SIZE to automatically calculate the width based on the height and the original aspect ratio.