SpriteSheetUVNode.html.md 1.0 KB

Inheritance: EventDispatcher → Node →

SpriteSheetUVNode

Can be used to compute texture coordinates for animated sprite sheets.

Code Example

const uvNode = spritesheetUV( vec2( 6, 6 ), uv(), time.mul( animationSpeed ) );
material.colorNode = texture( spriteSheet, uvNode );

Constructor

new SpriteSheetUVNode( countNode : Node., uvNode : Node., frameNode : Node. )

Constructs a new sprite sheet uv node.

countNode

The node that defines the number of sprites in the x and y direction (e.g 6x6).

uvNode

The uv node.

Default is uv().

frameNode

The node that defines the current frame/sprite.

Default is float().

Properties

.countNode : Node.

The node that defines the number of sprites in the x and y direction (e.g 6x6).

.frameNode : Node.

The node that defines the current frame/sprite.

.uvNode : Node.

The uv node.

Source

src/nodes/utils/SpriteSheetUVNode.js

粤ICP备19079148号