From 64c1246a45f7ee01820aa831da9b4ae1e90704ad Mon Sep 17 00:00:00 2001 From: Tim Young Date: Wed, 4 Oct 2017 03:14:34 +0200 Subject: [PATCH] Update UsingSprites --- UsingSprites.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/UsingSprites.md b/UsingSprites.md index 196b571..1a64f4f 100644 --- a/UsingSprites.md +++ b/UsingSprites.md @@ -26,6 +26,8 @@ A SpriteDatabase is another way to define named sprites. If your program only h The database allows you to build a file that defines all your sprites. If you instantiate your SpriteController with the Database, or you add it using SetSpriteDatabase, the SpriteController will reference the database when you asked for a named sprite. The nice thing about this, is that it spreads out the creation of sprites. In the AdventureDemo example, it took four or five seconds for the game to start while the SpriteController was creating the initial sprites. If a Database was used, the sprites would only be created when first referenced, which means that the load-time is virtually un-noticeable. +![The SpriteDatabase window for adding Sprites](images/SpriteDatabase.png) + The SpriteDatabase has the additional benefit of letting you define your sprites through a GUI. The OpenEditWindow function will allow you to browse through the images which you have already added as resources to your project. You can highlight an item to turn into a sprite, specify the number of frames, and even preview the sprite. Resources are read-only, so you use this function by instantiating the database by giving it a filename. Then you use the OpenEditWindow function of the database. When you are done defining your sprites, you can add the file as a resource to your program, and then instantiate the database using the resource name instead of the filename.