Skip to content
pixi-silk
GitHub repository
Class

ZoomControl

import { ZoomControl } from 'pixi-silk/ui/camera';

Experimental

A - 100% + pill for a Camera, 128x32 pixels. The buttons zoom around the view’s centre and the percentage fits the content (or resets). The readout follows the camera’s zoom signal. Place it in screen space, beside the world. Destroying it unsubscribes from the camera.

Experimental: the API may change in a minor release.

Extends#

  • Container

Constructors#

Constructor#

new ZoomControl(camera: Camera, options?: ZoomControlOptions): ZoomControl;

Experimental

Parameters#

ParameterType
cameraCamera
optionsZoomControlOptions

Returns#

ZoomControl

Overrides#

Container.constructor

Accessors#

size#

Get Signature#

get size(): [number, number];

Experimental

Width and height of the control in local units, [128, 32].

Returns

[number, number]

Methods#

destroy()#

destroy(options?: DestroyOptions): void;

Experimental

Removes all internal references and listeners as well as removes children from the display list. Do not use a Container after calling destroy.

Parameters#

ParameterTypeDescription
options?DestroyOptionsOptions parameter. A boolean will act as if all options have been set to that value

Returns#

void

Example#

container.destroy();
container.destroy(true);
container.destroy({ children: true });
container.destroy({ children: true, texture: true, textureSource: true });

Overrides#

Container.destroy