Docs / Sprites

Sprites are the graphics used by playable or interactive characters in your scenes. Add sprites to your game by including PNG files in your project’s assets/sprites folder.

Requirements

Sprite PNGs must only contain the following four colors:

#071821
#86c06c
#e0f8cf
#65ff00
Download the GB Studio Palette Swatches for:
Adobe Photoshop
Aseprite

The color #65ff00 is used to represent a transparent background in game and will be invisible in-game and in the World Editor.

Colors that are not one of the above hex codes will be matched to the nearest color. Unlike backgrounds, the color #306850 can not be used in sprites.

A sprite consists of one or more 16px x 16px frames laid out horizontally in file. A sprite with a single frame will be 16px x 16px while a sprite with three frames will be 48px x 16px.

Static sprites

For sprites that only need a single frame (e.g. static items such as signposts) create your PNG as a 16px x 16px image containing just the one frame required.

Animated sprites

If you want to have sprites that play short animations you can make a PNG with between 2 frames at 32px x 16px and 25 frames at 400px x 16px. Using these sprites on an actor will enable you to select which frame you want to display by default and will allow an animation to be played at a specified speed.

Actor

To make sprites that can face in four directions turning towards the player, create a 48px x 16px PNG containing the three frames forward facing, upwards facing and right facing. The left facing sprite is automatically generated by flipping the right facing sprite horizontally so does not need to be created.

Animated Actor

To make sprites that have animated movement, or that can be used as a player character, create a 96px x 16px PNG containing six frames, two forward facing, two upwards facing and two right facing animation frames.

As there are limits to how many sprites frames can be loaded into a single scene don’t use animated sprites unless you know your NPCs will need animated movement.

Next: Backgrounds