An interface for custom-drawn main screen UI elements. UI is an interface that lays on top of a wxWindow, providing a minimum set of functions that allow for totally custom-drawn, dynamically resizable UI elements to be located on the screen and correctly relocated and stretched when the user resizes the window, or resizes all UI elements. Each UI-derived class must provide a mechanism for calculating its correct origin when a window resize occurs.
wxWindow (see http://www.wxwindows.org/manuals/2.4.2/wx411.htm)
UI.h
An interface for custom-drawn main screen UI elements. | |
Calculates the origin of the UI given the screen rectangle. | |
Initializes the UI element. | |
Handles a user-initiated total UI resize. | |
The UI constructor. | |
The UI destructor. | |
The default UI constructor. |
|
Initializes the UI element. A derived class should perform any necessary setup in this function. Allows for a way to initialize all UI elements at one time, if the UI elements are stored as UI * in a container.
| game | The current Game. The UI may use information in the game to help initialize itself. |
|
Handles a user-initiated total UI resize. The UI interface provides a way for users to totally resize every main screen piece of UI in the game. Derived classes must implement this function, which supplies a percent from 1.0 to 2.0 inclusive that the default size of the UI should be multipled by. This allows all UI-derived classes to grow linearly by the same amounts when a user applies a resize percentage to the main screen.
| fPercent | The percentage of UI resize. Ranges from 1.0 to 2.0 inclusive. |
|
The UI constructor. All the same parameters as a standard wxWindow, which it simply passes along to.
| parent | The parent window (must not be NULL). |
| id | The id for message handling. |
| pos | The starting position. |
| size | The starting size. |
| style | The window style, using wxWindow parameters. |
| name | The name. |
|
|
|
|