Skip to content
pixi-silk
GitHub repository
Class

ValuePill

import { ValuePill } from 'pixi-silk/ui/pill';

A small rounded label for live readouts: angles while rotating, sizes while resizing, distances between snapped objects. Centred on its position. It has no ticker: call ValuePill.update each frame, or show and hide change nothing on screen. It ignores pointer events.

Extends#

  • Container

Constructors#

Constructor#

new ValuePill(options?: ValuePillOptions): ValuePill;

Parameters#

ParameterType
optionsValuePillOptions

Returns#

ValuePill

Overrides#

Container.constructor

Properties#

PropertyTypeDefault valueDescriptionDefined in
shownbooleanfalseWanted visibility. update fades towards it.ui/ValuePill.ts:34

Accessors#

text#

Get Signature#

get text(): string;

Current text. Setting it resizes the pill at once.

Returns

string

Set Signature#

set text(value: string): void;
Parameters
ParameterType
valuestring
Returns

void

Methods#

hide()#

hide(): void;

Fades the pill out on the next update calls.

Returns#

void


show()#

show(text?: string): void;

Sets the text, when given, and fades the pill in on the next update calls.

Parameters#

ParameterType
text?string

Returns#

void


update()#

update(dt: number): boolean;

Fades and scales towards shown by dt seconds. Returns true while fading.

Parameters#

ParameterType
dtnumber

Returns#

boolean