#include <Key.h>
Inheritance diagram for Key:
Public Member Functions | |
Key (const string &label, const string &name, Font *font, SDLKey defaultValue=SDLK_SPACE) | |
void | load (ifstream &file) |
void | save (ofstream &file) |
void | draw (float x, float y, float zoom) |
Type | getType () |
float | getWidth (float zoom) |
float | getHeight (float zoom) |
string & | getName () |
bool | isPressed () |
bool | keyPress () |
void | handleGameKeyboardEvent (SDL_Event *event) |
bool | handleKeyEvent (SDL_Event *event) |
Definition at line 13 of file Key.h.
|
Constructor lable is the name the user can see on screen. name is the name of the TextEntry in the config file. font is the Font to use when rendering. defaultValue is the SDLKey to use when no configration is loaded. |
|
Draws the MenuItem at x,y with a zoom factor of zoom (2 equals double size). The MenuItem may decide not to apply the scale or to only support some zoom steps, always check getWidth and getHeight if you need the excact size. Implements MenuItem. |
|
Returns the height of this MenuItem at zoom factor zoom, must be excact Implements MenuItem. |
|
Returns the name of the MenuItem used when save is called. The name may not contain a =. Implements MenuItem. |
|
Returns the Type of this control. Implements MenuItem. |
|
Returns the width of this MenuItem at zoom factor zoom, must be excact Implements MenuItem. |
|
Call this in your event loop with the events to make the key register the keyboard events (Otherwise isPressed and keyPress won't work) |
|
Called when a key press/release event occurs, return true if the MenuItem has handled the event. If true is returned the event handling will stop. Implements MenuItem. |
|
Returns true if the key is currently pressed. |
|
Returns true if the key has been pressed since the last time keyPress has been called. |
|
Reads the configuration for the MenuItem from any position within the file Hint: Use findLoadPosition to find you entry in the file Reimplemented from MenuItem. |
|
Saves the MenuItem at the current position in the file. Entrys must look like "name=value\n". Reimplemented from MenuItem. |