SuperSpriteSurface is a class framework for REALbasic that provides a savvy, modern alternative to REALbasic’s built in SpriteSurface control. SuperSpriteSurface improves upon REALbasic’s built in SpriteSurface control (or ad hoc 2D solutions created with REALbasic’s Rb3D system) in several areas:
SuperSpriteSurface uses OpenGL 2D functions to off load the graphics processing to the computer’s video card, resulting in the following benefits:
- Fast compositing of both small and huge images (i.e., 1×1 to 2048×2048)
- Storage of images in dedicated texture memory
- Images can have 24 bit color depths (millions of colors) with 8 bits of alpha (256 levels of grey)
- On-the-fly rotation, scaling and blending of images
Slick graphics aren’t worth much if you can’t create world that interacts with itself; that’s why extraordinary effort has gone into implementing a fast & robust collision detection system based on geometric bounding shapes. Multiple bounding shapes can be attached to your sprites at the same time, defining multiple “hit” regions. The types of bounding shapes that can be assigned include: Point, Circle, Line, Rectangle & Convex Polygon.
The collision system supports on-the-fly creation of collision sets (to limit the total number of shapes it has to cross check for collision). The system also caches pre-calculation collision results to further speed things up. Finally, when a collision occurs, the appropriate SuperSprite objects receive a collision event with details of the collision.
SuperSpriteSurface even supports a special debug mode which will overlay-draw your sprite’s collision shapes on top of your sprites — fine tune your game faster!
Time-based Animation Controller
SuperSpriteSurface offers another important improvement over the built in SpriteSurface: the animation controller is time based, as opposed to frame based.
This time based animation controller will ensure that motion in your game or animation appears constant, no matter the speed of the target machine, the refresh rate of its monitor, the number of frames-per-second or the number of sprites that are on screen at once.
SuperSpriteSurface’s animation controller runs in hard-looped (speed) and threaded (cooperative) modes.
Multiple Sprite Types
SuperSpriteSurface includes two subclasses to the default SuperSprite sprite class: SuperSpriteGroup & SuperSpriteTile.
SuperSpriteGroup lets you create a hierarchy of sprite objects, similar to REALbasic’s built in Group2D class.
SuperSpriteTile offers similar functionality to the PaintTile event in the REALbasic SpriteSurface control: it lets you seamlessly tile small images, allowing you to create huge backdrops from a few source images. Because SuperSpriteTile is a SuperSprite subclass it may be transformed: moved, scaled & rotated, like any other SuperSprite object. You can also layer multiple SuperSpriteTile objects to create parallax scrolling effects!
SuperSpriteTile is fast — the class performs on-the-fly culling of the tiles that are not on screen and then draws only the tiles that are potentially visible.
Pricing & Availibility
SuperSpriteSurface 1.0 costs just $29.95 a license and is available for immediate download and purchase.
Documentation & Examples
SuperSpriteSurface includes API documentation of the main control & classes, as well as an example project which contains several well-commented demos.
Here are a few screenshots from the included demo programs:
The clouds demo shows 100 scaled, translucent sprites scrolling off-screen. The frame rate varies but the motion appears constant.
The waves demo animates large images (the ships) and shows how SuperSpriteTile objects (the waves) can create graphics that repeat in one direction.
This collision demo animates each of the SuperSpriteSurface collision shapes. When a collision occurs, the shape turns red. Unlike the other demo programs, the shapes in this demo are not drawn with bit mapped pictures, but instead use the special collision shape debug-overlay mode.
The knights demo shows virtually all the major elements of SuperSpriteSurface working together.
The top-down demo shows the power of the SuperSpriteTile class in action. In the images below, the background comprises only five images. SuperSpriteTile allows you to specify the rotation of individual tiles in 90? increments. Without this control, twelve wall images would have been needed instead of three.