xyginext  0.2.0
Second generation of xygine game creation framework
Public Types | Public Member Functions | Public Attributes | Friends | List of all members
xy::UIHitBox Class Referencefinal

Used to trigger callbacks when hit events occur in the component's area. More...

#include <UIHitBox.hpp>

Public Types

enum  CallbackID {
  MouseEnter = 1, MouseExit, MouseDown, MouseUp,
  MouseMotion, MouseWheel, KeyDown, KeyUp,
  Selected, Unselected, ControllerButtonDown, ControllerButtonUp,
  Count
}
 

Public Member Functions

void setGroup (std::size_t group)
 Sets the group of UIHitbox controls to which this component belongs. By default all UIHitbox components are added to group 0. When creating multiple menus it is sometimes advantagous to activate smaller groups of components at a time. Use UISystem::setActiveGroup() to control which group of UIHitboxes currently receive input.
 
void setSelectionIndex (std::size_t index)
 Defines the order in which components in a group are selected. By default this is set based on the order in which components are added to a group.
 

Public Attributes

sf::FloatRect area
 
bool active = false
 
std::array< sf::Uint32, CallbackID::Count > callbacks {}
 
std::int32_t ID = -1
 

Friends

class UISystem
 

Detailed Description

Used to trigger callbacks when hit events occur in the component's area.