Scrolling Game Development Kit UI Help Up to Sprites and Paths

Defining Sprite Frames

This is part of a series of pages describing the Sprites and Paths dialog. This page describes the Frames tab.

The Frames tab defines parameters relating to the appearance of the sprite. Every sprite template contains a number of "Frames" that define which tiles from which tilesets are used to draw the sprite in various states. This tab defines what those states are, how many frames (for animated states) each state has, and which tilesets and tiles to use for each of these.

The first field "States" is used to select one of the basic predefined set of states that a GameDev sprite can have:

The "Editing sprite state" field indicates which state is currently being edited. The states listed here are determined by the "States" field and the checkbox. The "Animation Speed" slider applies to the entire template, not to the individual states, but the Tileset does apply do the individual states, meaning you can select a different tileset for each state if need be. It is recommended that all tilesets used for a particular sprite contain the same sized tiles.

There are 4 checkboxes at the top right. The last 3 are new with version 1.3:

At the bottom of the Frames tab is where the tiles for the individual frames of animation for each state can be dragged into the appropriate states. The tiles at the right are obtained from the currently selected tileset (which is assigned to the currently selected state). The preview window at the left displays the animation for the current state. The animation runs faster for higher animation speeds. (If you have the Tile Animation dialog and the Sprites and Paths dialog both open at the same time, only one preview can animate; if you experience problems, close one of these dialogs.) If the preview is empty, drag a tile from the tileset tiles at the right into the preview window to define which tile to display for the current state. If the current state is animated, continue to drag more tiles from the tileset into the current state in sequence until the desired animation for the current state is complete. If the state is not animated, one frame is sufficient. As of version 1.3 you can drag multiple tiles into the preview at once to add multiple frames into the animation. To do this, hold control while selecting the frames, then drag the selection into the preview. The frames will be added according to their sequence in the tileset. As of 1.4, you can also select a range of tiles by clicking on one tile and then shift-clicking another. All tiles between the two will be selected.

Note that an animated sprite (a sprite with animated states) may not always animate at a constant speed. The animation speed can be a factor of both the animation speed property and the speed at which the sprite is travelling. This causes a running sprite, for instance, to stop the running animation when the sprite is not moving, or to run slower when the sprite is moving slower. To change this behavior see the checkboxes at the top right of the frames tab (see 4 bullet points above for details).

There are three buttons between the preview and the tileset tiles. The "Clear" button clears the current state of all frames. The "Clear All" button clears all states in this template of all frames. The "<36-State<" button is useful for a 360/10 sprite. It starts at the currently selected state and the currently selected tile in the tileset tiles window. Then it appends the current tile to the current state and moves to the next state and the next tile. The process is repeated until 36 states are processed. If it reaches the last state it starts back at the first state, and if it reaches the last tile it starts back at the first tile. 36 frames are always appended somewhere, so the sprite template will always contain 36 more frames after this command than it did before. The common use for this is, on a new sprite template, to select the "Right" state (the first one) and the image of the sprite pointing to the right. Then clicking the "<36-State<" button fills out all the frames for the sprite automatically, assuming the subsequent tiles are all in order in the tileset (which is easy when using the make 360/10 button in the Tileset Editor). If there are multiple frames of animation for the sprite, simply repeat the process selecting the first sprite for the second frame, go back to the "Right" state and click "<36-State<" again. If there are separate accelerating states, "Right Accelerating" and "Right Drifting" can be selected in two presses of "<36-State<" to assign all 72 states. There is no fully automatic way to create a 36-state sprite that uses multiple tilesets. Each frame within a state must use the same tileset as all the other frames in that state.

Current limitations: there is no way to re-arrange the frames within a state; there is no way to delete a single frame from a state (use Clear All and re-add relavent tiles); there is no way to set different delays for different animation frames (add multiple copies of the same tile); there is no way to use a different tileset for each frame within a state; there is no way to separate "Positive acceleration" (forward) from "Negative acceleration" (backward) states; there is no distinct state for "stopped" when the sprite stops moving -- it remains in the state it was, displaying the frame where it ended up, or resets to the first frame if the appropriate box is checked. Some of these limitations may be overcome through the use of scripting.