Sprite

Introduction

Sprites are used to render a texture to the screen. Sprites are one of the most common types of FlatRedBall objects. Examples of Sprites include:

  • Character graphics (static or animated)
  • Backgrounds
  • Particles
  • Tile graphics
  • Bullets

Creating a Sprite

Sprites can be added to Glue screens or entities, although most games don’t include Sprites directly in screens.

To add a Sprite to an entity:

  1. Create or select an existing entity or screen
  2. Right-click on the Objects node
  3. Select Add Object
  4. Select the FlatRedBall or Custom Type category
  5. Select the Sprite type
  6. Click OK

Sprite Texture

Sprites usually display textures, which are created from image files such as .png files. To add and display a texture on a Sprite:

  1. Create a Sprite in a screen or entity as shown above
  2. Find a .png which you would like to use
  3. Drag+drop the .png file onto your screen or entity’s Files folder in Glue
  4. Select the Sprite in the same screen or entity with the newly-added file
  5. Change its Texture property to the newly-added file

The Sprite will now display the texture in the preview window and in game.