Grey Alien BlitzMax Game Framework: Common
Types V1.04
Copyright (c) 2007 by Jake Birkett
Introduction
CommonType.bmx contains a large library of very useful
types including the main TGame type. It also contains several keyboard and
mouse functions which override the BRL ones because the framework uses it's own
event-based input.
The file is split into 5 sections as follows:
- Consts and Globals
- General Error Handling function
- Event-based Input functions
- Types
- Version History
Function Listing
- HandleGeneralError: Catches errors and displays an error message
- KeyHit: Overrides BRL's KeyHit with a framework version
- KeyDown: Overrides BRL's KeyDown with a framework version
- GetChar: Overrides BRL's GetChar with a framework version
- AnyKeyPressed: detects if any key is pressed when PolledInput is disabled
- FlushKeys: Overrides BRL's FlushKeys with a framework version
- FlushMouse: Overrides BRL's FlushMouse with a framework version
Type Listing
- TGame: Encapsulates standard game globals and functions. This is the main type in the framework.
- TAnimation: Has a counter and an active flag, can support multiple phases, and has useful methods
- TBox: scores position and dimensions and draws it
- TButton: Extends TSprite to make a clickable button with many features
- TChannelArray: holds a list of TGameChannels and manages them
- TColor : Holds RGB and Alpha values, and has useful methods.
- TCounter: Stores counter, length, active, and manages itself
- TCounterList: Stores a list of TCounters and manages them
- TCrossFade: Cross fades one image (or screen) over another - very cool
- TDebugVar: Times how long a certain section of code takes to run
- TDialog: Abstract auto-centred Dialog type with caption and background
- TDialogOK: Extends TDialog to add an OK button
- TDialogTextInput : Extends TDialog to add a TTextInput, an OK button and an optional Cancel button
- TDialogYesNo : Extends TDialog to add a Yes and No buttons
- TExitScreen : Dummy type for TGame to use
- TExplosion : Explosion exended from TSprite as an example
- TExplosionList: Holds and manages a list of TExplosions
- TFade: fades an image in a loop, such as a splash screen
- TFixedRateLogic: 'keeps a game's logic running at a fixed rate, independent of refresh rate
- TFont: Wraps TImageFont so that other details and methods can be included
- TFPSCounter: Tracks and updates the Frames Per Second, every second.
- TGameChannel: wraps a channel, name and other data for use with TChannelArray
- TGameFade: Stores current and max integers and can display them
- TGameImage: Wraps TImage with name, dimensions, midhandled, and and has useful methods
- TGameObject: Extends TSprite and can be used for pretty much anything you want
- TGameObjectList: Holds a list of TGameObjects and manages them
- TGameSound: Wraps TSound with name, pitch, volume, and has useful methods
- THighScore: Holds name, score and level
- THighScoreList: Contains and manages a list of THighScores
- TImageBank : Holds a list of TGameImages, each with a name so that it can be looked up easily
- TIniFile: Creates, Saves and Loads an Ini file
- TIniLine: Stores Name$ and Value$ (suitable for ini files)
- TLabel: Extends TFont to include a text label and a drawing method
- TListBox: Stores, draws and manages a list of strings
- TLoadingBar: Draws and handles a loading bar
- TLoadingScreen: Extends TScreen to add some loading text, a loading bar and a click here button
- TMenu: Holds a list of TButtons and manages them
- TMousePointer: Contains mouse pointer image, coordinates and button states
- TParticle: Extends TSprite and has many useful properties and methods including phased animation
- TParticleGenerator: Generates particles at a given interval by calling a user defined function
- TParticleGeneratorList: holds a list of TParticleGenerators and manages them
- TParticleList : holds a list of TParticles and manages them
- TParticlePhase: Holds the properties for a particular phase of particle animation
- TPlayerManager: Extends TDialog to show a list of TProfiles and buttons to manage them
- TProfile: Store player profile information and saves and loads the data
- TScreen : Abstract type that you can extend into other screens
- TShadow: Stores and applies shadow information such as X,Y offset and Alpha
- TSineCounter: Loops through a sinewave to smoothly return values 0 to 1 to 0 to -1 to 0
- TSlideLine: Can slide a line of text around in multiple phases
- TSlideLineList: Holds a list of TSlideLines and manages them
- TSlider: Extends TSprite and allows users to slide a marker along a meter
- TSoundBank: Holds a list of TGameSounds, each with a name so that it can be looked up easily
- TSprite: 2D image or animation type that holds lots of information and contains many useful methods
- TTextCursor: Outputs text at a cursor position in graphics mode
- TTextInput: Allows user to type in text in a graphics window.
- TTrackingVar: Stores current and max integers and can display them