9 #ifndef TurtleBrainsExpress_InterfaceElement_hpp
10 #define TurtleBrainsExpress_InterfaceElement_hpp
12 #include <turtle_brains/express/interface/tbx_interface.hpp>
13 #include <turtle_brains/graphics/tb_graphic_list.hpp>
26 class InterfaceHandlerInterface;
43 const State& GetState(
void)
const;
44 void SetState(
const State& newState);
57 void SetFunction(std::function<
void(ElementHandle)> handlerFunction, ElementHandle elementHandle);
58 void SetFunction(std::function<
void()> callbackFunction);
60 void HandleUserEvent(
const UserEvent& userEvent);
61 void LinkToNeighbor(
const NavigationDirection& direction,
Element* element);
63 Point GetPosition(
void)
const;
68 void Render(
void)
const;
71 virtual void OnRender(
void)
const;
72 virtual void OnActivate(
void);
74 virtual bool ContainsPointer(
const Point& pointerPosition)
const;
75 virtual bool CanLinkWithNeighbor(
const NavigationDirection& direction)
const;
76 virtual void OnStateChange(
const State& newState);
78 virtual void OnHandleUserEvent(
const UserEvent& userEvent);
79 virtual void OnHandleActiveUserEvent(
const UserEvent& userEvent);
81 Element* FindNextElementInDirection(
const NavigationDirection& direction,
bool enabledOnly);
84 void ClearGraphics(
void);
87 void ClearGraphics(
const State& state);
93 std::array<tbGraphics::GraphicList, 5> mStateGraphics;
94 std::array<Element*, 4> mNeighbors;
97 std::function<void(ElementHandle)> mFunctionHandler;
98 std::function<void(void)> mFunctionCallback;
99 ElementHandle mElementHandle;
Definition: tb_graphic.hpp:61
Definition: tb_graphic_list.hpp:27
Definition: tbx_interface.hpp:66
A collection of objects and functions to express games quickly.
Definition: tbx_interface.hpp:18
Definition: tbx_interface_handler_interface.hpp:27
Definition: tbx_interface.hpp:58
tbCore::uint16 PixelSpace
Definition: tb_texture_manager.hpp:36
Definition: tbx_interface_element.hpp:28
void SetHandler(InterfaceHandlerInterface *handler, const ElementHandle &elementHandle)