SilkMessageLayer
import { SilkMessageLayer } from 'pixi-silk/i18n/pixi';
A container that draws the glyphs of its SilkMessage children together: one draw call per bundle and theme, however many messages (brief sec. 7, M6). The merged instances carry each message’s index, and a data texture carries each message’s transform and alpha, so moving a message costs no instance write. Messages stay normal children: position, rotate, scale, hide and tap them as usual. Inline objects and text slots still draw on their own.
Example#
import { SilkMessage, SilkMessageLayer } from 'pixi-silk/i18n/pixi';
const layer = new SilkMessageLayer();
for (const name of set.names()) layer.addChild(new SilkMessage(set.get(name)));
app.stage.addChild(layer);
Extends#
Container
Constructors#
Constructor#
new SilkMessageLayer(): SilkMessageLayer;
Returns#
SilkMessageLayer
Overrides#
Container.constructor
Accessors#
drawCount#
Get Signature#
get drawCount(): number;
Draw calls the layer issues for its messages: one per bundle and theme in use.
Returns
number
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#
| Parameter | Type | Description |
|---|---|---|
options? | DestroyOptions | Options 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