-
Notifications
You must be signed in to change notification settings - Fork 27
Sprite
This article describes a temporary implementation in FudgeAid. Sprites should be controlled by the Animation Component at a later stage.
A sprite is a flat image in the game world that changes its content to display an animation.
A spritesheet is a texture image that shows the various phases of the animation. Only a small portion of that texture is rendered to a sprite at a given time, followed by another portion shortly thereafter, creating the impression of a smooth animation.
A node with a material and a mesh component attached, that represents a sprite. It's an extension of the class Node with additional methods to control the size of the quad referenced by the mesh-component and the portion of the texture to render on that quad.
Is a dataset containg a reference to the spritesheet and an array of information about the sequence of frames for the animation, respectively the sizes of the quad, the transformation of the spritesheet, the duration of the frame etc.
The class SpriteSheetAnimation implements methods for convenient generation of the frame sequence. If the spritesheet is based on a regular grid, it's particularly easy to use the method generateByGrid
.