The package is the workhorse of the system. The Screen Manager executes all packages in its Update() (input and update packages) and Draw() (render packages) methods.
Packages are executed in the order they are registered.
Package owners can dynamically enable and disable their packages to control behavior and display.
The "guts" of a package is a delegate of the type required by the package. This allows for great flexibility, reuse of code, and elimination of inheritence as a customization mechanism.

Update Package

The Update Package is where all the logic and calculations are performed. Enabled Update Packages are executed by the Screen Manager it its Update() method. Update Packages typically contain the values they are maintaining, which makes for a nice container, instead of ad hoc management of computed values in the Master Layer class.

Render Package

The Render Package is where all the drawing is performed. Enabled Render Packages are executed by the Screen Manager it its Draw() method. Multiple Render Packages can be used to draw in layers back-to-front, and Render Packages can be enabled and disabled (by Input and Update Packages) as necessary.

Input Package

The Input Package is where input event matching and action is performed. Different Input Packages exist for triggering on key press/down/release, mouse press/down/release, game pad, etc.
Input Packages may also be enabled/disabled under program control.

Last edited Jul 7, 2008 at 5:14 PM by escapellc, version 1


No comments yet.