|
enum | Flags { RightMouse = 0x1,
LeftMouse = 0x2,
MiddleMouse = 0x4,
Finger = 0x8
} |
| Input flags. Use these with the callback bitmask to find which input triggered it.
|
|
using | MouseButtonCallback = std::function< void(Entity, sf::Uint64 flags)> |
|
using | MovementCallback = std::function< void(Entity, sf::Vector2f)> |
|
using | MouseWheelCallback = std::function< void(Entity, bool, float)> |
|
using | KeyboardCallback = std::function< void(Entity, sf::Keyboard::Key)> |
|
using | SelectionChangedCallback = std::function< void(Entity)> |
|
using | ControllerCallback = std::function< void(Entity, sf::Uint32, sf::Uint32)> |
|
using | Ptr = std::unique_ptr< System > |
|
|
| UISystem (MessageBus &) |
|
void | handleEvent (const sf::Event &) |
| Used to pass in any events the system may be interested in.
|
|
void | process (float) override |
| Performs processing.
|
|
void | handleMessage (const Message &) override |
| Message handler.
|
|
std::uint32_t | addMouseButtonCallback (const MouseButtonCallback &) |
| Adds a mouse button event callback. More...
|
|
std::uint32_t | addMouseMoveCallback (const MovementCallback &) |
| Adds a mouse or touch input movement callback. This is similar to button even callbacks, only the movement delta is passed in as a parameter instead of a button ID. These are also used for mouse enter/exit events Note that a single callback ID may be assigned to multiple UIHitbox components.
|
|
std::uint32_t | addMouseWheelCallback (const MouseWheelCallback &) |
| Adds a mouse wheel input callback. Mouse wheel callbacks handle scroll events from the mouse wheel. Callback parameters are: Entity the current UI entity which triggered this callback bool true if the mouse wheel is vertical (most common) false if it is horizontal float delta - positive is up/left, negative is down/right. May be non-integral on some mice. More...
|
|
std::uint32_t | addKeyCallback (const KeyboardCallback &) |
| Adds a KeyEvent callback. More...
|
|
std::uint32_t | addSelectionCallback (const SelectionChangedCallback &) |
| Adds a selection changed callback. This is raised for each UIHitbox component as it either either selected or unselected. The callback function passes in the entity which is affected by the callback. Note that a single callback ID may be assigned to multiple UIHitbox components.
|
|
std::uint32_t | addControllerCallback (const ControllerCallback &) |
| Adds a Controller Button callback. The callback passes in the entity which is affects, as well as the controller ID and Button ID which triggered the event.
|
|
void | selectInput (std::size_t) |
| Selects the input at the given index if it exists. This is applied to the active group of components. More...
|
|
void | setJoypadCursorActive (bool active) |
| Enables controlling the mouse cursor with the controller connected to port 0. When this is enabled all mouse movement callbacks are executed as they would with a normal mouse move, controller button and mouse button callbacks remain unchanged. More...
|
|
void | setActiveGroup (std::size_t) |
| Sets the active group of UIHitbox components. By default all components are added to group 0. If a single UISystem handles multiple menus, for example, UIHitbox components can be grouped by a given index, one for each menu. This function will set the active group of UIHitbox components to recieve events. More...
|
|
| System (MessageBus &mb, UniqueType t) |
| Constructor. Pass in a reference to the concrete implementation to generate a unique type ID for this system.
|
|
UniqueType | getType () const |
| Returns the unique type ID of the system.
|
|
const std::vector< Entity > & | getEntities () const |
| Returns a list of entities that this system is currently interested in.
|
|
void | addEntity (Entity) |
| Adds an entity to the list to process.
|
|
void | removeEntity (Entity) |
| Removes an entity from the list to process.
|
|
const ComponentMask & | getComponentMask () const |
| Returns the component mask used to mask entities with corresponding components for this system to process.
|
|
bool | isActive () const |
| Returns true if the system is currently active. Systems can be activeated and deactivated with Scene::setSystemActive()
|
|
template<typename T > |
void | requireComponent () |
|
template<typename T > |
T * | postMessage (Message::ID id) |
|
Updates entities with UIHitBox components. Any entity with a UIHitBox component will be processed by this system, which detects user input and activates the appropriate callback as necessary.
- See also
- UIHitBox