Title scene: Background sprite

The next step is to create a background for the scene.
Here we will create a filled sprite. Filled sprites are simply a sprite that is filled with a single color.
In this case we will have a black background. You can pick many colors from the CoreGraphics object or you can even enter the hex values.
For example Black 0×000000, White 0xffffff, Red, 0xff0000, Green 0×00ff00, Blue 0×0000ff
By specifying no size the filled sprite is automatically set to the size of the stage which is exactly what we want.
Also note that the background sprite is not added to our sceneGroup. All Scene2D objects have a base group that is drawn before all other groups.
This is exactly what we need for a background. It also lets us animate our sceneGroup as a whole without displacing the background.

Previous
Next