Sprite Layers

Introduction

Sprite layers allow for sprites to be generated from individual components, or layers. This functionally allows for a user to have individual pieces in different sprites (e.g. head, hair, eyes, body, armor, weapon, etc.) and then stitch them together based on a drawing order.

If a sprite layer is not provided to a sprite that would otherwise use it, that layer will be ignored.

Properties

System

NameExplanationType
NameThe name of the sprite layer.String

Drawing Order

NameExplanationType
Draw OrderThe standard order for drawing the sprite.Number
Reverse Draw OrderThe order when drawing the sprite facing north (or backwards). This applies to when a sprite would face North, Northeast, or Northwest.Number

Example

Suppose a sprite (standard four direction) is to be composed of three layers (body, head, hair) that each have a corresponding draw order of (1, 2, 3) and a reverse draw order of (2, 1, 3).

When facing a non-north direction, the character would be drawn in the following order: body, head, hair. When facing a northern direction, the character would be drawn in the following order: head, body, hair.

Best Practice: Sprite layers generate a new sprite behind the covers of the engine. They are only extended to support Characters at the moment.