Skip to content
pixi-silk
GitHub repository
Class

IslandMenu

import { IslandMenu } from 'pixi-silk/ui/island';

Rows of switches, choices and actions, sized for the open state of a small island: a settings menu that grows out of a gear. Its box is IslandMenu.boxWidth by IslandMenu.boxHeight from (0, 0). Switches slide when their signal changes, from a tap or from elsewhere.

Extends#

  • Container

Constructors#

Constructor#

new IslandMenu(options: IslandMenuOptions): IslandMenu;

Parameters#

ParameterType
optionsIslandMenuOptions

Returns#

IslandMenu

Overrides#

Container.constructor

Properties#

PropertyModifierTypeDescriptionDefined in
boxHeightreadonlynumberHeight of the menu’s box, local units.packages/pixi-silk/src/ui/island/menu.ts:81
boxWidthreadonlynumberWidth of the menu’s box, local units.packages/pixi-silk/src/ui/island/menu.ts:79

Methods#

destroy()#

destroy(options?: DestroyOptions): void;

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

select()#

select(index: number): void;

Taps a row by index, as a pointer would.

Parameters#

ParameterType
indexnumber

Returns#

void


tick()#

tick(dt: number): boolean;

Advances the switches by dt seconds (for ticker: null). Returns true while one moves.

Parameters#

ParameterType
dtnumber

Returns#

boolean