![]() |
OpenXcom
1.0
Open-source clone of the original X-Com
|
Container for all the information associated with a given user action, like mouse clicks, key presses, etc. More...
#include <Action.h>
Public Member Functions | |
| Action (SDL_Event *ev, double scaleX, double scaleY, int topBlackBand, int leftBlackBand) | |
| Creates an action with given event data. More... | |
| ~Action () | |
| Cleans up the action. | |
| double | getXScale () const |
| Gets the screen's X scale. More... | |
| double | getYScale () const |
| Gets the screen's Y scale. More... | |
| void | setMouseAction (int mouseX, int mouseY, int surfaceX, int surfaceY) |
| Sets the action as a mouse action. More... | |
| bool | isMouseAction () const |
| Gets if the action is a mouse action. | |
| int | getTopBlackBand () const |
| Gets the top black band height. More... | |
| int | getLeftBlackBand () const |
| Gets the left black band width. More... | |
| int | getXMouse () const |
| Gets the mouse's X position. More... | |
| int | getYMouse () const |
| Gets the mouse's Y position. More... | |
| double | getAbsoluteXMouse () const |
| Gets the mouse's absolute X position. More... | |
| double | getAbsoluteYMouse () const |
| Gets the mouse's absolute Y position. More... | |
| double | getRelativeXMouse () const |
| Gets the mouse's relative X position. More... | |
| double | getRelativeYMouse () const |
| Gets the mouse's relative Y position. More... | |
| InteractiveSurface * | getSender () const |
| Gets the sender of the action. More... | |
| void | setSender (InteractiveSurface *sender) |
| Sets the sender of the action. More... | |
| SDL_Event * | getDetails () const |
| Gets the details of the action. More... | |
Container for all the information associated with a given user action, like mouse clicks, key presses, etc.
| OpenXcom::Action::Action | ( | SDL_Event * | ev, |
| double | scaleX, | ||
| double | scaleY, | ||
| int | topBlackBand, | ||
| int | leftBlackBand | ||
| ) |
| double OpenXcom::Action::getAbsoluteXMouse | ( | ) | const |
Gets the mouse's absolute X position.
Returns the absolute X position of the mouse cursor relative to the game window, corrected for screen scaling.
| double OpenXcom::Action::getAbsoluteYMouse | ( | ) | const |
Gets the mouse's absolute Y position.
Returns the absolute Y position of the mouse cursor relative to the game window, corrected for screen scaling.
| SDL_Event * OpenXcom::Action::getDetails | ( | ) | const |
Gets the details of the action.
Returns the details about this action.
| int OpenXcom::Action::getLeftBlackBand | ( | ) | const |
Gets the left black band width.
Returns the width in pixel of the left black band if any.
| double OpenXcom::Action::getRelativeXMouse | ( | ) | const |
Gets the mouse's relative X position.
Returns the relative X position of the mouse cursor relative to the surface that triggered the action, corrected for screen scaling.
| double OpenXcom::Action::getRelativeYMouse | ( | ) | const |
Gets the mouse's relative Y position.
Returns the relative X position of the mouse cursor relative to the surface that triggered the action, corrected for screen scaling.
| InteractiveSurface * OpenXcom::Action::getSender | ( | ) | const |
Gets the sender of the action.
Returns the interactive surface that triggered this action (the sender).
| int OpenXcom::Action::getTopBlackBand | ( | ) | const |
Gets the top black band height.
Returns the height in pixel of the top black band if any.
| int OpenXcom::Action::getXMouse | ( | ) | const |
Gets the mouse's X position.
Returns the X position of the mouse cursor relative to the game window, or -1 if this isn't a mouse-related action.
| double OpenXcom::Action::getXScale | ( | ) | const |
Gets the screen's X scale.
Returns the X scaling factor used by the screen when this action was fired (used to correct mouse input).
| int OpenXcom::Action::getYMouse | ( | ) | const |
Gets the mouse's Y position.
Returns the Y position of the mouse cursor relative to the game window, or -1 if this isn't a mouse-related action.
| double OpenXcom::Action::getYScale | ( | ) | const |
Gets the screen's Y scale.
Returns the Y scaling factor used by the screen when this action was fired (used to correct mouse input).
| void OpenXcom::Action::setMouseAction | ( | int | mouseX, |
| int | mouseY, | ||
| int | surfaceX, | ||
| int | surfaceY | ||
| ) |
| void OpenXcom::Action::setSender | ( | InteractiveSurface * | sender | ) |
Sets the sender of the action.
Changes the interactive surface that triggered this action (the sender).
| sender | Pointer to interactive surface. |
1.8.14