pixi-reels

ReelWarp

pixi-reels


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#

ParameterTypeDefault valueDescription
_sourceContainerundefinedthe reel’s own container. It is rendered to a texture rather than drawn, so the caller must keep it OUT of the scene graph
_rendererRendererundefinedthe renderer to draw the reel with
_curveReelCurveundefinedthe projection to displace vertices by
_axisReelAxisundefinedthe reel’s travel projection
widthnumberundefinedscreen width of the reel’s box
heightnumberundefinedscreen height of the reel’s box
tickerTickerundefined-
_marginnumber0-
_bleednumber0-

Returns#

ReelWarp

Overrides#

Container.constructor

Accessors#

isDestroyed#

Get Signature#

get isDestroyed(): boolean;

Defined in: core/ReelWarp.ts:91

Returns

boolean

Implementation of#

Disposable.isDestroyed

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#

Disposable.destroy

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#

ParameterType
widthnumber
heightnumber

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