ReelWarp
pixi-reels / index / ReelWarp
Class: ReelWarp
Defined in: core/ReelWarp.ts:30
Bend a whole reel, whatever is inside it.
ReelCurve’s per-symbol projection only bends content that IS a
texture: a Container transform is affine, so Spine skeletons, Graphics,
text and composites come out moved-but-flat.
This renders the reel to a texture and draws it through a mesh whose vertices carry the same projection, so everything inside bends and no symbol cooperates. It also sidesteps the per-symbol path’s atlas-frame problem, since a render texture owns its whole source.
Costs one render pass per reel per frame and one resample, so hairline art is
marginally softer. Symbols are no longer real display objects to the
renderer, so use ReelSet.getCellQuad() rather than screen-space hit tests.
Extends#
Container
Implements#
Constructors#
Constructor#
new ReelWarp(
_source: Container,
_renderer: Renderer,
_curve: ReelCurve,
_axis: ReelAxis,
width: number,
height: number,
ticker: Ticker,
_margin?: number,
_bleed?: number
): ReelWarp;
Defined in: core/ReelWarp.ts:47
Parameters#
| Parameter | Type | Default value | Description |
|---|---|---|---|
_source | Container | undefined | the reel’s own container. It is rendered to a texture rather than drawn, so the caller must keep it OUT of the scene graph |
_renderer | Renderer | undefined | the renderer to draw the reel with |
_curve | ReelCurve | undefined | the projection to displace vertices by |
_axis | ReelAxis | undefined | the reel’s travel projection |
width | number | undefined | screen width of the reel’s box |
height | number | undefined | screen height of the reel’s box |
ticker | Ticker | undefined | - |
_margin | number | 0 | - |
_bleed | number | 0 | - |
Returns#
ReelWarp
Overrides#
Container.constructor
Accessors#
isDestroyed#
Get Signature#
get isDestroyed(): boolean;
Defined in: core/ReelWarp.ts:91
Returns
boolean
Implementation of#
Methods#
destroy()#
destroy(): void;
Defined in: core/ReelWarp.ts:136
Removes all internal references and listeners as well as removes children from the display list.
Do not use a Container after calling destroy.
Returns#
void
Example#
container.destroy();
container.destroy(true);
container.destroy({ children: true });
container.destroy({ children: true, texture: true, textureSource: true });
Implementation of#
Overrides#
Container.destroy
resize()#
resize(width: number, height: number): void;
Defined in: core/ReelWarp.ts:123
Re-measure after a reshape, and re-displace the grid.
Parameters#
| Parameter | Type |
|---|---|
width | number |
height | number |
Returns#
void
update()#
update(): void;
Defined in: core/ReelWarp.ts:99
Redraw the reel into its texture. Called once per frame, after the motion layer has moved the symbols and before the stage is drawn.
Returns#
void