gbSpriteDemo provides a demonstration of displaying, move, resizing and rotating
sprite images. Multiple image file formats (bmp/png/gif/jpg) are supported. The capability
is provided by a single function which may be easily dropped into other PowerBASIC applicatons.
gbSpriteDemo makes use of two Win32 API, PlgBlt and TransparentBlt. These API allow rotation
and the designation of a specific transparency color.
The technique demonstarted by gbSpriteDemo is
gbSpriteDemo is NOT a sprite engine. The technique of generating, animating, and
controlling many sprites is very different than the approach used in gbSpriteDemo. Also,
gbSpriteDemo does not use/require the alpha channel found in some file formats.
To install, just unzip the contents of the distribution file into a folder of its own!
gbSpriteDemo uses a single window, consisting of a toolbar and a graphic control which displays the
track and rider.
gbSpriteDemo provides a variety of features.
- Select sprite (any user image)
- Multiple file formats - bmp/gif/jpg/png
- Display one or more sprites
- Place center of sprite at cursor
- Place upper left corner of sprite at cursor
- Set sprite zoom factor
- Drag last sprite to new location
- Use MouseWheel to rotate sprite
- Use MouseWheel to set rotation angle for next sprite
- Display center, image, and rotation outlines
- Select transparency color
- Remove all sprites
- Remove all but last sprite
- Set display background color
- Save display image betwen sessions
- Online Help
You can put as many icons on the screen as you want ...
And you apply a zoom factor to each sprite ...
And you can show the center, image, and rotation boundaries of a sprite as well ...
All gbSpriteDemo features and settings are accessed through the toolbar buttons.
- Select - Select a sprite to display
- Clear - Clear all sprites
- Last Only - Clear all but the last sprite
- Sprite - Reset the last sprite to zero rotation
- Theta - Change the rotation angle (for the next sprite) to zero
- Zoom - Set sprite zoom factor (25% to 400%)
- T-Color - Set transparency color
- BGColor - Set display background color
- Outlines - Display sprite center, image and rotation outlines
- Centered - When displaying sprites, center sprite at cursor
- AutoClear - When a sprite is displayed, all other sprites are removed
- Help - Open this online Help page
The following key combinations are available to the user to access gbSpriteDemo features:
- F1 - Help
- Ctrl+A - Clear all previous sprites when a new sprite is drawn
- Ctrl+B - Set background color
- Ctrl+H - Local Help
- Ctrl+N - Clear all sprites
- Ctrl+O - Open dialog to select sprite
- Ctrl+S - Display sprite outlines
- Ctrl+T - Set transparency color
- Ctrl+Z - Set last sprite rotation angle to zero
Comments and suggestions are welcome!