Code Walkthrough
If you haven't already, skim over the StepMania class hierarchies diagrams. The Actor and Screen hierarchies are of particular interest.
Contents |
Actor
Actor.h/cpp
Actor is the base class for most elements you see on the screen. Actors have a position, rotation, color, and other properties. Update() and Draw() are called on them once per frame.
Sprite
Actor.h/cpp
Sprite is an Actor that draws a bitmap. The logo on the title screen and the scrolling arrows during gameplay are both examples.
BitmapText
BitmapText.h/cpp
BitmapText is an Actor that has a text property. It uses a bitmap font to draw characters to the screen every frame. The credits text at the bottom of the screen is an example of a BitmapText element.
ActorFrame
ActorFrame.h/cpp
An ActorFrame is an Actor that contains other Actors. First, Actors are added to an ActorFrame. Then, calling Update() or Draw() on an ActorFrame will recursively call Update() and Draw() on all children of the ActorFrame.
Screen
Screen*.h/cpp
A Screen is an ActorFrame that also handles input and contains game logic. To move Actors or make other things happen when the user presses a button, insert some logic in a Screen's Input() method.
ThemeManager
ThemeManager.h/cpp
ThemeManager is the global singleton object that is responsible for feeding graphics, sound, animation files, and screen order information to the game code.
All theme files reside in the Themes/ directory. metrics.ini is the central theme file and defines things like screen order and what choices are available on each screen. When Screens are loaded, they ask theme manager ThemeManager which menu choices, graphics, animations, and sounds to display to the user.
File access
StepMania abstracts file access. The most typical way to read or write a file is through RageFile class.
To perform other, less-common file operations like Move and Delete, see RageFileManager.cpp/h (the global singleton FILEMAN).
Another useful function is GetDirListing, which enumerates files in the supplied directory and also accepts wildcards.

