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#
| Parameter | Type |
|---|---|
options | ValuePillOptions |
Returns#
ValuePill
Overrides#
Container.constructor
Properties#
| Property | Type | Default value | Description | Defined in |
|---|---|---|---|---|
shown | boolean | false | Wanted 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
| Parameter | Type |
|---|---|
value | string |
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#
| Parameter | Type |
|---|---|
text? | string |
Returns#
void
update()#
update(dt: number): boolean;
Fades and scales towards shown by dt seconds. Returns true while fading.
Parameters#
| Parameter | Type |
|---|---|
dt | number |
Returns#
boolean