1681-engine / index / Text
Class: Text ​
Defined in: src/core/Text.ts:18
Canvas text in world or screen space.
Extends ​
Text<this> &GameObjectMembers<this>
Constructors ​
Constructor ​
new Text(
x,
y,
text,
style
): Text;Defined in: src/core/Text.ts:19
Parameters ​
| Parameter | Type |
|---|---|
x | number |
y | number |
text | string |
style | TextStyle |
Returns ​
Text
Overrides ​
GameObject(PixiText).constructorProperties ​
active ​
readonly active: boolean;Defined in: src/core/gameObject.ts:42
False once destroyed.
Inherited from ​
GameObject(PixiText).activedepth ​
depth: number;Defined in: src/core/gameObject.ts:44
The draw order in the world layer (zIndex): bigger is in front.
Inherited from ​
GameObject(PixiText).depthflipX ​
flipX: boolean;Defined in: src/core/gameObject.ts:48
Inherited from ​
GameObject(PixiText).flipXflipY ​
flipY: boolean;Defined in: src/core/gameObject.ts:49
Inherited from ​
GameObject(PixiText).flipYscaleX ​
scaleX: number;Defined in: src/core/gameObject.ts:46
Scale without the flip: stays positive on a mirrored sprite.
Inherited from ​
GameObject(PixiText).scaleXscaleY ​
scaleY: number;Defined in: src/core/gameObject.ts:47
Inherited from ​
GameObject(PixiText).scaleYscene ​
scene: Stage;Defined in: src/core/gameObject.ts:40
Inherited from ​
GameObject(PixiText).sceneMethods ​
clearTint() ​
clearTint(): this;Defined in: src/core/gameObject.ts:64
Returns ​
this
Inherited from ​
GameObject(PixiText).clearTintdestroy() ​
Call Signature ​
destroy(options?): void;Defined in: node_modules/pixi.js/lib/scene/text/AbstractText.d.ts:481
Destroys this text renderable and optionally its style texture.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
options? | DestroyOptions | Options parameter. A boolean will act as if all options have been set to that value |
Returns ​
void
Example ​
// Destroys the text and its style
text.destroy({ style: true, texture: true, textureSource: true });
text.destroy(true);
text.destroy() // Destroys the text, but not its styleInherited from ​
GameObject(PixiText).destroyCall Signature ​
destroy(): void;Defined in: src/core/gameObject.ts:67
Returns ​
void
Inherited from ​
GameObject(PixiText).destroysetAlpha() ​
setAlpha(a?): this;Defined in: src/core/gameObject.ts:55
Parameters ​
| Parameter | Type |
|---|---|
a? | number |
Returns ​
this
Inherited from ​
GameObject(PixiText).setAlphasetAngle() ​
setAngle(a?): this;Defined in: src/core/gameObject.ts:59
Parameters ​
| Parameter | Type |
|---|---|
a? | number |
Returns ​
this
Inherited from ​
GameObject(PixiText).setAnglesetBlendMode() ​
setBlendMode(mode): this;Defined in: src/core/gameObject.ts:60
Parameters ​
| Parameter | Type |
|---|---|
mode | BLEND_MODES |
Returns ​
this
Inherited from ​
GameObject(PixiText).setBlendModesetDepth() ​
setDepth(d): this;Defined in: src/core/gameObject.ts:54
Parameters ​
| Parameter | Type |
|---|---|
d | number |
Returns ​
this
Inherited from ​
GameObject(PixiText).setDepthsetFlip() ​
setFlip(x, y): this;Defined in: src/core/gameObject.ts:53
Parameters ​
| Parameter | Type |
|---|---|
x | boolean |
y | boolean |
Returns ​
this
Inherited from ​
GameObject(PixiText).setFlipsetFlipX() ​
setFlipX(v): this;Defined in: src/core/gameObject.ts:51
Parameters ​
| Parameter | Type |
|---|---|
v | boolean |
Returns ​
this
Inherited from ​
GameObject(PixiText).setFlipXsetFlipY() ​
setFlipY(v): this;Defined in: src/core/gameObject.ts:52
Parameters ​
| Parameter | Type |
|---|---|
v | boolean |
Returns ​
this
Inherited from ​
GameObject(PixiText).setFlipYsetOrigin() ​
setOrigin(x?, y?): this;Defined in: src/core/Text.ts:37
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
x | number | 0.5 |
y | number | x |
Returns ​
this
setPosition() ​
setPosition(x?, y?): this;Defined in: src/core/gameObject.ts:57
Parameters ​
| Parameter | Type |
|---|---|
x? | number |
y? | number |
Returns ​
this
Inherited from ​
GameObject(PixiText).setPositionsetRotation() ​
setRotation(r?): this;Defined in: src/core/gameObject.ts:58
Parameters ​
| Parameter | Type |
|---|---|
r? | number |
Returns ​
this
Inherited from ​
GameObject(PixiText).setRotationsetScale() ​
setScale(x, y?): this;Defined in: src/core/gameObject.ts:50
Parameters ​
| Parameter | Type |
|---|---|
x | number |
y? | number |
Returns ​
this
Inherited from ​
GameObject(PixiText).setScalesetScrollFactor() ​
setScrollFactor(f): this;Defined in: src/core/gameObject.ts:66
0 pins the object to the screen instead of the world.
Parameters ​
| Parameter | Type |
|---|---|
f | number |
Returns ​
this
Inherited from ​
GameObject(PixiText).setScrollFactorsetText() ​
setText(text): this;Defined in: src/core/Text.ts:42
Parameters ​
| Parameter | Type |
|---|---|
text | string |
Returns ​
this
setTint() ​
setTint(color?): this;Defined in: src/core/gameObject.ts:61
Parameters ​
| Parameter | Type |
|---|---|
color? | number |
Returns ​
this
Inherited from ​
GameObject(PixiText).setTintsetTintFill() ​
setTintFill(color): this;Defined in: src/core/gameObject.ts:63
Paints every opaque pixel in one solid colour (hit flash, silhouettes).
Parameters ​
| Parameter | Type |
|---|---|
color | number |
Returns ​
this
Inherited from ​
GameObject(PixiText).setTintFillsetVisible() ​
setVisible(v): this;Defined in: src/core/gameObject.ts:56
Parameters ​
| Parameter | Type |
|---|---|
v | boolean |
Returns ​
this
Inherited from ​
GameObject(PixiText).setVisible