Loading...
Searching...
No Matches
ml::Typer Class Reference

An animated text object that accepts keyboard input. More...

#include <Malena/Graphics/Text/Typer.h>

Inheritance diagram for ml::Typer:
[legend]

Public Types

using Flag
using Flag
using manifest_type
 The manifest type, used by GatherFlags and GatherStates to locate this class's flag and state declarations.
using manifest_type
 The manifest type, used by GatherFlags and GatherStates to locate this class's flag and state declarations.
using State
 The enum type this manager stores flags for.
using State
 The enum type this manager stores flags for.
using State
using State
enum  Style

Public Member Functions

 Typer (const sf::Font &font=FontManager<>::getDefault())
 Construct a Typer with a given font.
void addComponent (Core &child)
void addComponent (Core &child)
void addComponent (Core &child, E layer)
 Register a child at a layer identified by any enum value.
void addComponent (Core &child, E layer)
 Register a child at a layer identified by any enum value.
void addComponent (Core &child, int layer)
void addComponent (Core &child, int layer)
void addComponents (Children &... children)
 Register multiple child components at the default layer.
void addComponents (Children &... children)
 Register multiple child components at the default layer.
void addComponents (E layer, Children &... children)
 Variadic shared-layer registration with an enum layer key.
void addComponents (E layer, Children &... children)
 Variadic shared-layer registration with an enum layer key.
void addComponents (int layer, Children &... children)
 Register multiple child components at a shared layer.
void addComponents (int layer, Children &... children)
 Register multiple child components at a shared layer.
void center (T &obj)
 Center this object within obj (both axes).
void center (sf::Text &obj)
 Center this object within obj (both axes).
void center (sf::Text &obj)
 Center this object within obj (both axes).
template<class T>
void center (T &obj)
 Center this object within obj (both axes).
void centerHorizonally (T &obj)
 Center this object horizontally within obj.
void centerHorizonally (sf::Text &obj)
 Center this object horizontally within obj.
void centerHorizonally (sf::Text &obj)
 Center this object horizontally within obj.
template<class T>
void centerHorizonally (T &obj)
 Center this object horizontally within obj.
void centerText (sf::Text &obj)
 Center an sf::Text object within this object's bounds.
void centerText (sf::Text &obj)
 Center an sf::Text object within this object's bounds.
void centerVertically (T &obj)
 Center this object vertically within obj.
void centerVertically (sf::Text &obj)
 Center this object vertically within obj.
void centerVertically (sf::Text &obj)
 Center this object vertically within obj.
template<class T>
void centerVertically (T &obj)
 Center this object vertically within obj.
bool checkFlag (State state) const
 Return the current value of a flag.
bool checkFlag (State state) const
 Return the current value of a flag.
bool checkFlag (State state) const
 Return the current value of a flag.
void clearDragBounds ()
 Remove any previously set drag bounds.
void clearDragBounds ()
 Remove any previously set drag bounds.
void disableFlag (State state)
 Set a flag to false.
void disableFlag (State state)
 Set a flag to false.
void disableFlag (State state)
 Set a flag to false.
void draw (sf::RenderTarget &target, sf::RenderStates states) const override
 Draw this graphic to an SFML render target.
void enableFlag (State state)
 Set a flag to true.
void enableFlag (State state)
 Set a flag to true.
void enableFlag (State state)
 Set a flag to true.
Vector2f findCharacterPos (std::size_t index) const
unsigned int getCharacterSize () const
Color getFillColor () const
const Font & getFont () const
sf::FloatRect getGlobalBounds () const override
 Return the axis-aligned bounding box in world space.
const Transform & getInverseTransform () const
float getLetterSpacing () const
float getLineSpacing () const
FloatRect getLocalBounds () const
Vector2f getOrigin () const
Color getOutlineColor () const
float getOutlineThickness () const
sf::Vector2f getPosition () const override
 Return the current world-space position.
virtual sf::RenderStates getRenderStates () const
virtual sf::RenderStates getRenderStates () const
Angle getRotation () const
Vector2f getScale () const
std::enable_if_t<!std::is_void_v< sf::Text >, sf::TextgetState () const
 Return the current state value.
std::enable_if_t<!std::is_void_v< sf::Text >, sf::TextgetState () const
 Return the current state value.
const String & getString () const
std::uint32_t getStyle () const
const Transform & getTransform () const
 Graphic ()
template<typename U>
 Graphic (const U &obj)
 Construct from an existing SFML object of type U.
bool isEffectivelyVisible () const
 True only if this component and every ancestor are visible.
bool isEffectivelyVisible () const
 True only if this component and every ancestor are visible.
bool isEnabled () const
bool isEnabled () const
bool isScrolling ()
 Return true while a moveTo or moveDistance animation is in progress.
bool isScrolling ()
 Return true while a moveTo or moveDistance animation is in progress.
std::enable_if_t<!std::is_void_v< T >, bool > isState (T state) const
 Return true if currently in state.
std::enable_if_t<!std::is_void_v< sf::Text >, bool > isState (sf::Text state) const
 Return true if currently in state.
std::enable_if_t<!std::is_void_v< sf::Text >, bool > isState (sf::Text state) const
 Return true if currently in state.
std::enable_if_t<!std::is_void_v< T >, bool > isState (T state) const
 Return true if currently in state.
bool isVisible () const
bool isVisible () const
void move (Vector2f offset)
void moveDistance (sf::Vector2f distance, float seconds=1.f)
 Animate by a relative offset from the current position.
void moveDistance (sf::Vector2f distance, float seconds=1.f)
 Animate by a relative offset from the current position.
void moveTo (sf::FloatRect position, float seconds=1.f)
 Animate to a position defined by a FloatRect origin.
void moveTo (sf::FloatRect position, float seconds=1.f)
 Animate to a position defined by a FloatRect origin.
void moveTo (sf::Vector2f position, float seconds=1.f)
 Animate to an absolute world-space position.
void moveTo (sf::Vector2f position, float seconds=1.f)
 Animate to an absolute world-space position.
void onBlur (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when this component loses keyboard focus.
void onBlur (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when this component loses keyboard focus.
void onBlur (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=true)
 Register a callback invoked when this component loses keyboard focus, receiving the raw SFML event.
void onBlur (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=true)
 Register a callback invoked when this component loses keyboard focus, receiving the raw SFML event.
void onClick (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when this component is clicked.
void onClick (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when this component is clicked.
void onClick (std::function< void(const std::optional< sf::Event > &event)> callback, bool overwrite=true)
 Register a callback invoked when this component is clicked, receiving the raw SFML event.
void onClick (std::function< void(const std::optional< sf::Event > &event)> callback, bool overwrite=true)
 Register a callback invoked when this component is clicked, receiving the raw SFML event.
void onFocus (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when this component gains keyboard focus.
void onFocus (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when this component gains keyboard focus.
void onFocus (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=true)
 Register a callback invoked when this component gains keyboard focus, receiving the raw SFML event.
void onFocus (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=true)
 Register a callback invoked when this component gains keyboard focus, receiving the raw SFML event.
void onHover (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when the mouse enters this component's bounds.
void onHover (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when the mouse enters this component's bounds.
void onHover (std::function< void(const std::optional< sf::Event > &event)> callback, bool overwrite=true)
 Register a callback invoked when the mouse enters this component's bounds, receiving the raw SFML event.
void onHover (std::function< void(const std::optional< sf::Event > &event)> callback, bool overwrite=true)
 Register a callback invoked when the mouse enters this component's bounds, receiving the raw SFML event.
void onKeypress (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when a key is pressed while this component has focus.
void onKeypress (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when a key is pressed while this component has focus.
void onKeypress (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=true)
 Register a callback invoked when a key is pressed while this component has focus, receiving the raw SFML event.
void onKeypress (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=true)
 Register a callback invoked when a key is pressed while this component has focus, receiving the raw SFML event.
void onKeyRelease (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when a key is released while this component has focus.
void onKeyRelease (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when a key is released while this component has focus.
void onKeyRelease (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=true)
 Register a callback invoked when a key is released while this component has focus, receiving the raw SFML event.
void onKeyRelease (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=true)
 Register a callback invoked when a key is released while this component has focus, receiving the raw SFML event.
void onMouseMoved (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked whenever the mouse moves anywhere in the window.
void onMouseMoved (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked whenever the mouse moves anywhere in the window.
void onMouseMoved (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=true)
 Register a callback invoked whenever the mouse moves anywhere in the window, receiving the raw SFML event.
void onMouseMoved (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=true)
 Register a callback invoked whenever the mouse moves anywhere in the window, receiving the raw SFML event.
void onMousePressed (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when a mouse button is pressed anywhere in the window.
void onMousePressed (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when a mouse button is pressed anywhere in the window.
void onMousePressed (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=true)
 Register a callback invoked when a mouse button is pressed, receiving the raw SFML event.
void onMousePressed (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=true)
 Register a callback invoked when a mouse button is pressed, receiving the raw SFML event.
void onMouseReleased (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when a mouse button is released anywhere in the window.
void onMouseReleased (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when a mouse button is released anywhere in the window.
void onMouseReleased (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=true)
 Register a callback invoked when a mouse button is released, receiving the raw SFML event.
void onMouseReleased (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=true)
 Register a callback invoked when a mouse button is released, receiving the raw SFML event.
void onScroll (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when the mouse wheel is scrolled while the cursor is over this component.
void onScroll (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when the mouse wheel is scrolled while the cursor is over this component.
void onScroll (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=true)
 Register a callback invoked when the mouse wheel is scrolled while the cursor is over this component, receiving the SFML event.
void onScroll (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=true)
 Register a callback invoked when the mouse wheel is scrolled while the cursor is over this component, receiving the SFML event.
std::enable_if_t<!std::is_void_v< T > > onStateEnter (std::function< void(T)> callback)
 Register a callback invoked after each state transition.
std::enable_if_t<!std::is_void_v< sf::Text > > onStateEnter (std::function< void(sf::Text)> callback)
 Register a callback invoked after each state transition.
std::enable_if_t<!std::is_void_v< sf::Text > > onStateEnter (std::function< void(sf::Text)> callback)
 Register a callback invoked after each state transition.
std::enable_if_t<!std::is_void_v< T > > onStateEnter (std::function< void(T)> callback)
 Register a callback invoked after each state transition.
std::enable_if_t<!std::is_void_v< T > > onStateExit (std::function< void(T)> callback)
 Register a callback invoked before each state transition.
std::enable_if_t<!std::is_void_v< sf::Text > > onStateExit (std::function< void(sf::Text)> callback)
 Register a callback invoked before each state transition.
std::enable_if_t<!std::is_void_v< sf::Text > > onStateExit (std::function< void(sf::Text)> callback)
 Register a callback invoked before each state transition.
std::enable_if_t<!std::is_void_v< T > > onStateExit (std::function< void(T)> callback)
 Register a callback invoked before each state transition.
void onTextEntered (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when a unicode character is entered while this component has focus.
void onTextEntered (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when a unicode character is entered while this component has focus.
void onTextEntered (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=true)
 Register a callback invoked when a unicode character is entered while this component has focus, receiving the raw SFML event.
void onTextEntered (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=true)
 Register a callback invoked when a unicode character is entered while this component has focus, receiving the raw SFML event.
void onUnhover (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when the mouse leaves this component's bounds.
void onUnhover (std::function< void()> callback, bool overwrite=true)
 Register a no-argument callback invoked when the mouse leaves this component's bounds.
void onUnhover (std::function< void(const std::optional< sf::Event > &event)> callback, bool overwrite=true)
 Register a callback invoked when the mouse leaves this component's bounds, receiving the raw SFML event.
void onUnhover (std::function< void(const std::optional< sf::Event > &event)> callback, bool overwrite=true)
 Register a callback invoked when the mouse leaves this component's bounds, receiving the raw SFML event.
void onUpdate (std::function< void()> callback, bool overwrite=false)
 Register a no-argument callback invoked every frame.
void onUpdate (std::function< void()> callback, bool overwrite=false)
 Register a no-argument callback invoked every frame.
void onUpdate (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=false)
 Register a callback invoked every frame, receiving the SFML event.
void onUpdate (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=false)
 Register a callback invoked every frame, receiving the SFML event.
void onWindowFocusGained (std::function< void()> callback, bool overwrite=false)
 Register a no-argument callback invoked when the application window gains OS focus.
void onWindowFocusGained (std::function< void()> callback, bool overwrite=false)
 Register a no-argument callback invoked when the application window gains OS focus.
void onWindowFocusGained (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=false)
 Register a callback invoked when the application window gains OS focus, receiving the raw SFML event.
void onWindowFocusGained (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=false)
 Register a callback invoked when the application window gains OS focus, receiving the raw SFML event.
void onWindowFocusLost (std::function< void()> callback, bool overwrite=false)
 Register a no-argument callback invoked when the application window loses OS focus.
void onWindowFocusLost (std::function< void()> callback, bool overwrite=false)
 Register a no-argument callback invoked when the application window loses OS focus.
void onWindowFocusLost (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=false)
 Register a callback invoked when the application window loses OS focus, receiving the raw SFML event.
void onWindowFocusLost (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=false)
 Register a callback invoked when the application window loses OS focus, receiving the raw SFML event.
virtual void onWindowResize (unsigned int, unsigned int)
virtual void onWindowResize (unsigned int, unsigned int)
void onWindowResized (std::function< void()> callback, bool overwrite=false)
 Register a no-argument callback invoked when the application window is resized.
void onWindowResized (std::function< void()> callback, bool overwrite=false)
 Register a no-argument callback invoked when the application window is resized.
void onWindowResized (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=false)
 Register a callback invoked when the application window is resized, receiving the raw SFML event.
void onWindowResized (std::function< void(const std::optional< sf::Event > &)> callback, bool overwrite=false)
 Register a callback invoked when the application window is resized, receiving the raw SFML event.
 operator const sf::Drawable & () const
 Implicit conversion to a const sf::Drawable reference.
virtual void process (const std::string &key, const std::optional< sf::Event > &event)
 Invoke all callbacks registered for key.
virtual void process (const std::string &key, const std::optional< sf::Event > &event)
 Invoke all callbacks registered for key.
void process (ENUM_TYPE eventName, const std::optional< sf::Event > &event)
 Invoke all callbacks registered for eventName.
void process (ENUM_TYPE eventName, const std::optional< sf::Event > &event)
 Invoke all callbacks registered for eventName.
void process (ENUM_TYPE eventName, const std::optional< sf::Event > &event)
 Invoke all callbacks registered for eventName.
void process (ENUM_TYPE eventName, const std::optional< sf::Event > &event)
 Invoke all callbacks registered for eventName.
void publish (ENUM_TYPE event, FilterCallback filter=[](EventReceiver &){ return true;}, SystemCallback resolve=nullptr, SystemCallback reject=nullptr)
 Fire an enum-keyed event to all matching subscribers.
void publish (ENUM_TYPE event, FilterCallback filter=[](EventReceiver &){ return true;}, SystemCallback resolve=nullptr, SystemCallback reject=nullptr)
 Fire an enum-keyed event to all matching subscribers.
void removeComponent (Core &child)
void removeComponent (Core &child)
void rotate (Angle angle)
void scale (Vector2f factor)
void setAbove (T &obj, float spacing=0)
 Position this object immediately above obj.
void setAbove (sf::Text &obj, float spacing=0)
 Position this object immediately above obj.
void setAbove (sf::Text &obj, float spacing=0)
 Position this object immediately above obj.
template<class T>
void setAbove (T &obj, float spacing=0)
 Position this object immediately above obj.
virtual void setActive (bool active)
virtual void setActive (bool active)
void setBelow (T &obj, float spacing=0)
 Position this object immediately below obj.
void setBelow (sf::Text &obj, float spacing=0)
 Position this object immediately below obj.
void setBelow (sf::Text &obj, float spacing=0)
 Position this object immediately below obj.
template<class T>
void setBelow (T &obj, float spacing=0)
 Position this object immediately below obj.
void setCharacterSize (unsigned int size)
void setDragBounds (const sf::FloatRect &bounds)
 Constrain drag movement to an axis-aligned bounding rectangle.
void setDragBounds (const sf::FloatRect &bounds)
 Constrain drag movement to an axis-aligned bounding rectangle.
void setEnabled (bool enabled)
void setEnabled (bool enabled)
void setFillColor (Color color)
void setFlag (State state, bool status)
 Set a flag to an explicit value.
void setFlag (State state, bool status)
 Set a flag to an explicit value.
void setFlag (State state, bool status)
 Set a flag to an explicit value.
void setFont (const Font &&font)=delete
void setFont (const Font &font)
void setFramerate (float framerate)
 Set the assumed framerate for movement interpolation.
void setFramerate (float framerate)
 Set the assumed framerate for movement interpolation.
void setLeftOf (T &obj, float spacing=0)
 Position this object immediately to the left of obj.
void setLeftOf (sf::Text &obj, float spacing=0)
 Position this object immediately to the left of obj.
void setLeftOf (sf::Text &obj, float spacing=0)
 Position this object immediately to the left of obj.
template<class T>
void setLeftOf (T &obj, float spacing=0)
 Position this object immediately to the left of obj.
void setLetterSpacing (float spacingFactor)
void setLineSpacing (float spacingFactor)
void setOrigin (Vector2f origin)
void setOutlineColor (Color color)
void setOutlineThickness (float thickness)
void setParentEnabled (bool enabled)
void setParentEnabled (bool enabled)
void setPosition (const sf::Vector2f &position) override
 Set the world-space position.
void setPosition (Vector2f position)
void setRightOf (T &obj, float spacing=0)
 Position this object immediately to the right of obj.
void setRightOf (sf::Text &obj, float spacing=0)
 Position this object immediately to the right of obj.
void setRightOf (sf::Text &obj, float spacing=0)
 Position this object immediately to the right of obj.
template<class T>
void setRightOf (T &obj, float spacing=0)
 Position this object immediately to the right of obj.
void setRotation (Angle angle)
void setScale (Vector2f factors)
std::enable_if_t<!std::is_void_v< T > > setState (T newState)
 Transition to a new state.
std::enable_if_t<!std::is_void_v< sf::Text > > setState (sf::Text newState)
 Transition to a new state.
std::enable_if_t<!std::is_void_v< sf::Text > > setState (sf::Text newState)
 Transition to a new state.
std::enable_if_t<!std::is_void_v< T > > setState (T newState)
 Transition to a new state.
void setString (const String &string)
void setStyle (std::uint32_t style)
virtual void setVisible (bool visible)
virtual void setVisible (bool visible)
void subscribe (ENUM_TYPE event, Callback callback)
 Subscribe to an enum-keyed event with a no-argument callback.
void subscribe (ENUM_TYPE event, Callback callback)
 Subscribe to an enum-keyed event with a no-argument callback.
void subscribe (ENUM_TYPE event, EventCallback callback)
 Subscribe to an enum-keyed event with a full SFML event callback.
void subscribe (ENUM_TYPE event, EventCallback callback)
 Subscribe to an enum-keyed event with a full SFML event callback.
void toggleFlag (State state)
 Flip a flag between true and false.
void toggleFlag (State state)
 Flip a flag between true and false.
void toggleFlag (State state)
 Flip a flag between true and false.
CoretopmostMatching (const std::function< bool(Core &)> &accept)
 Find the front-most (last-painted) node in this subtree that satisfies accept, searching topmost-first.
CoretopmostMatching (const std::function< bool(Core &)> &accept)
 Find the front-most (last-painted) node in this subtree that satisfies accept, searching topmost-first.
void unsubscribe (EnumType event)
 Unsubscribe from a single event by enum value.
void unsubscribe (EnumType event)
 Unsubscribe from a single event by enum value.
void unsubscribeAll ()
 Remove all event subscriptions for this component.
void unsubscribeAll ()
 Remove all event subscriptions for this component.

Static Public Member Functions

static void linkChild (Core *parent, Core *child)
static void linkChild (Core *parent, Core *child)
static void unlinkAll (Core *core)
static void unlinkAll (Core *core)

Public Attributes

 Bold
 Italic
 Regular
 StrikeThrough
 Underlined

Static Public Attributes

static constexpr int DefaultLayer
static constexpr int DefaultLayer

Protected Member Functions

void drawChildren (sf::RenderTarget &target, sf::RenderStates states) const
void drawChildren (sf::RenderTarget &target, sf::RenderStates states) const
const std::vector< Child > & getChildren () const
const std::vector< Child > & getChildren () const
virtual void onEnabledChanged (bool enabled)
virtual void onEnabledChanged (bool enabled)

Detailed Description

An animated text object that accepts keyboard input.

Typer extends Graphic<sf::Text> with keyboard event handling, making it the editable text layer inside TextInput. It registers event subscriptions internally in registerEvents() so that key presses and text-entered events update the displayed string.

Typer is not typically used standalone — TextInput composes a Typer (the editable content) and a Cursor (the blinking caret) into a ready-to-use input field.

Direct use (unusual)

ml::Typer typer;
typer.setPosition({100.f, 200.f});
typer.setCharacterSize(20);
addComponent(typer);
void addComponent(Core &child)
void setPosition(const sf::Vector2f &position) override
Set the world-space position.
An animated text object that accepts keyboard input.
Definition Typer.h:39
void setCharacterSize(unsigned int size)
See also
TextInput, Cursor, Text

Definition at line 38 of file Typer.h.

Member Typedef Documentation

◆ Flag [1/2]

using ml::Draggable::Flag
inherited

Definition at line 73 of file Draggable.h.

◆ Flag [2/2]

using ml::Draggable::Flag
inherited

Definition at line 73 of file Draggable.h.

◆ manifest_type [1/2]

using ml::Customizable< DraggableManifest >::manifest_type
inherited

The manifest type, used by GatherFlags and GatherStates to locate this class's flag and state declarations.

Definition at line 65 of file Customizable.h.

◆ manifest_type [2/2]

using ml::Customizable< DraggableManifest >::manifest_type
inherited

The manifest type, used by GatherFlags and GatherStates to locate this class's flag and state declarations.

Definition at line 65 of file Customizable.h.

◆ State [1/4]

using ml::FlagManager< Flag >::State
inherited

The enum type this manager stores flags for.

Definition at line 63 of file FlagManager.h.

◆ State [2/4]

using ml::FlagManager< Flag >::State
inherited

The enum type this manager stores flags for.

Definition at line 63 of file FlagManager.h.

◆ State [3/4]

using ml::Draggable::State
inherited

Definition at line 74 of file Draggable.h.

◆ State [4/4]

using ml::Draggable::State
inherited

Definition at line 74 of file Draggable.h.

Constructor & Destructor Documentation

◆ Typer()

ml::Typer::Typer ( const sf::Font & font = FontManager<>::getDefault())

Construct a Typer with a given font.

Calls registerEvents() to set up keyboard and text-entered subscriptions.

Parameters
fontFont for the editable text. Defaults to the built-in Arial font via FontManager<>::getDefault().

Member Function Documentation

◆ addComponent() [1/6]

void ml::Core::addComponent ( Core & child)
inherited

◆ addComponent() [2/6]

void ml::Core::addComponent ( Core & child)
inherited

◆ addComponent() [3/6]

void ml::Core::addComponent ( Core & child,
E layer )
inlineinherited

Register a child at a layer identified by any enum value.

Sugar over addComponent(child, int) — the enum's underlying integer value is used as the layer key. Lets manifests declare a domain-meaningful Layer enum and pass it directly at the call site without explicit casts:

class MyManifest : public ml::Manifest {
public:
enum class Layer : int {
Backdrop = 0,
Content = 100,
Controls = 150,
};
};
class MyWidget : public ml::ComponentWith<MyManifest> {
public:
using Layer = MyManifest::Layer;
MyWidget() {
addComponent(_bg, Layer::Backdrop);
addComponent(_input, Layer::Controls);
}
};
Base class for all Malena manifests.
Definition Manifest.h:51
Component< M, Traits... > ComponentWith
Alias for Component<M, Traits...>.
Definition Component.h:316
Layer
Framework-provided default layer enum.
Definition Core.h:52
@ Content
Definition Core.h:54

Also accepts ml::Layer (the framework-provided default) when a component has no manifest of its own.

Definition at line 205 of file Core.h.

◆ addComponent() [4/6]

void ml::Core::addComponent ( Core & child,
E layer )
inlineinherited

Register a child at a layer identified by any enum value.

Sugar over addComponent(child, int) — the enum's underlying integer value is used as the layer key. Lets manifests declare a domain-meaningful Layer enum and pass it directly at the call site without explicit casts:

class MyManifest : public ml::Manifest {
public:
enum class Layer : int {
Backdrop = 0,
Content = 100,
Controls = 150,
};
};
class MyWidget : public ml::ComponentWith<MyManifest> {
public:
using Layer = MyManifest::Layer;
MyWidget() {
addComponent(_bg, Layer::Backdrop);
addComponent(_input, Layer::Controls);
}
};

Also accepts ml::Layer (the framework-provided default) when a component has no manifest of its own.

Definition at line 205 of file Core.h.

◆ addComponent() [5/6]

void ml::Core::addComponent ( Core & child,
int layer )
inherited

◆ addComponent() [6/6]

void ml::Core::addComponent ( Core & child,
int layer )
inherited

◆ addComponents() [1/6]

void ml::Core::addComponents ( Children &... children)
inlineinherited

Register multiple child components at the default layer.

Equivalent to calling addComponent for each argument. Use this in a composite component's constructor when several fixed member components need to participate in the enable/disable cascade.

ChatWindow() { addComponents(_scrollPane, _input, _sendBtn); }
void addComponents(Children &... children)
Definition Core.h:243

Definition at line 243 of file Core.h.

◆ addComponents() [2/6]

void ml::Core::addComponents ( Children &... children)
inlineinherited

Register multiple child components at the default layer.

Equivalent to calling addComponent for each argument. Use this in a composite component's constructor when several fixed member components need to participate in the enable/disable cascade.

ChatWindow() { addComponents(_scrollPane, _input, _sendBtn); }

Definition at line 243 of file Core.h.

◆ addComponents() [3/6]

void ml::Core::addComponents ( E layer,
Children &... children )
inlineinherited

Variadic shared-layer registration with an enum layer key.

addComponents(Layer::Controls, _input, _sendBtn);

Definition at line 276 of file Core.h.

◆ addComponents() [4/6]

void ml::Core::addComponents ( E layer,
Children &... children )
inlineinherited

Variadic shared-layer registration with an enum layer key.

addComponents(Layer::Controls, _input, _sendBtn);

Definition at line 276 of file Core.h.

◆ addComponents() [5/6]

void ml::Core::addComponents ( int layer,
Children &... children )
inlineinherited

Register multiple child components at a shared layer.

addComponents(200, _input, _sendBtn); // foreground row
}

Definition at line 260 of file Core.h.

◆ addComponents() [6/6]

void ml::Core::addComponents ( int layer,
Children &... children )
inlineinherited

Register multiple child components at a shared layer.

addComponents(200, _input, _sendBtn); // foreground row
}

Definition at line 260 of file Core.h.

◆ center() [1/4]

void ml::Positionable::center ( T & obj)
inherited

Center this object within obj (both axes).

Template Parameters
TAny type with getGlobalBounds().
Parameters
objContainer to center within.

◆ center() [2/4]

void ml::Positionable::center ( sf::Text & obj)
inherited

Center this object within obj (both axes).

Template Parameters
TAny type with getGlobalBounds().
Parameters
objContainer to center within.

◆ center() [3/4]

void ml::Positionable::center ( sf::Text & obj)
inherited

Center this object within obj (both axes).

Template Parameters
TAny type with getGlobalBounds().
Parameters
objContainer to center within.

◆ center() [4/4]

template<class T>
void ml::Positionable::center ( T & obj)
inherited

Center this object within obj (both axes).

Template Parameters
TAny type with getGlobalBounds().
Parameters
objContainer to center within.

◆ centerHorizonally() [1/4]

void ml::Positionable::centerHorizonally ( T & obj)
inherited

Center this object horizontally within obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objContainer to center within.

◆ centerHorizonally() [2/4]

Center this object horizontally within obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objContainer to center within.

◆ centerHorizonally() [3/4]

Center this object horizontally within obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objContainer to center within.

◆ centerHorizonally() [4/4]

template<class T>
void ml::Positionable::centerHorizonally ( T & obj)
inherited

Center this object horizontally within obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objContainer to center within.

◆ centerText() [1/2]

void ml::Positionable::centerText ( sf::Text & obj)
inherited

Center an sf::Text object within this object's bounds.

Convenience overload for the common pattern of centering a text label inside a button or panel.

Parameters
objThe sf::Text to reposition.

◆ centerText() [2/2]

void ml::Positionable::centerText ( sf::Text & obj)
inherited

Center an sf::Text object within this object's bounds.

Convenience overload for the common pattern of centering a text label inside a button or panel.

Parameters
objThe sf::Text to reposition.

◆ centerVertically() [1/4]

void ml::Positionable::centerVertically ( T & obj)
inherited

Center this object vertically within obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objContainer to center within.

◆ centerVertically() [2/4]

Center this object vertically within obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objContainer to center within.

◆ centerVertically() [3/4]

Center this object vertically within obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objContainer to center within.

◆ centerVertically() [4/4]

template<class T>
void ml::Positionable::centerVertically ( T & obj)
inherited

Center this object vertically within obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objContainer to center within.

◆ checkFlag() [1/3]

bool ml::FlagManager< Flag >::checkFlag ( State state) const
inherited

Return the current value of a flag.

Returns false for any flag that has never been explicitly set.

Parameters
stateThe flag to query.
Returns
true if the flag is enabled; false otherwise.

◆ checkFlag() [2/3]

bool ml::FlagManager< Flag >::checkFlag ( State state) const
inherited

Return the current value of a flag.

Returns false for any flag that has never been explicitly set.

Parameters
stateThe flag to query.
Returns
true if the flag is enabled; false otherwise.

◆ checkFlag() [3/3]

bool ml::FlagManager< Flag >::checkFlag ( State state) const
inherited

Return the current value of a flag.

Returns false for any flag that has never been explicitly set.

Parameters
stateThe flag to query.
Returns
true if the flag is enabled; false otherwise.

◆ clearDragBounds() [1/2]

void ml::Draggable::clearDragBounds ( )
inherited

Remove any previously set drag bounds.

After this call the component can be dragged freely across the window with no position clamping. Has no effect if no bounds were set.

◆ clearDragBounds() [2/2]

void ml::Draggable::clearDragBounds ( )
inherited

Remove any previously set drag bounds.

After this call the component can be dragged freely across the window with no position clamping. Has no effect if no bounds were set.

◆ disableFlag() [1/3]

void ml::FlagManager< Flag >::disableFlag ( State state)
inherited

Set a flag to false.

Parameters
stateThe flag to disable.

◆ disableFlag() [2/3]

void ml::FlagManager< Flag >::disableFlag ( State state)
inherited

Set a flag to false.

Parameters
stateThe flag to disable.

◆ disableFlag() [3/3]

void ml::FlagManager< Flag >::disableFlag ( State state)
inherited

Set a flag to false.

Parameters
stateThe flag to disable.

◆ draw()

void ml::Graphic< sf::Text >::draw ( sf::RenderTarget & target,
sf::RenderStates states ) const
overridevirtualinherited

Draw this graphic to an SFML render target.

Delegates to T::draw after applying any render states returned by getRenderStates() (e.g., a shader set on this component).

Parameters
targetSFML render target (window or texture).
statesCurrent render states (transform, blend mode, etc.).

Implements sf::Drawable.

◆ drawChildren() [1/2]

void ml::Core::drawChildren ( sf::RenderTarget & target,
sf::RenderStates states ) const
protectedinherited

Render all registered children in layer order, skipping invisible ones. The framework default draw uses this; derived classes that override draw to add procedural visuals (background, decoration) or to wrap the loop in a clip view call this at the appropriate point.

void Panel::draw(target, states) const {
Rectangle::draw(target, states); // background
drawChildren(target, states); // children loop
}
void drawChildren(sf::RenderTarget &target, sf::RenderStates states) const
void draw(sf::RenderTarget &target, sf::RenderStates states) const override
Draw this graphic to an SFML render target.
virtual void draw(RenderTarget &target, RenderStates states) const=0

◆ drawChildren() [2/2]

void ml::Core::drawChildren ( sf::RenderTarget & target,
sf::RenderStates states ) const
protectedinherited

Render all registered children in layer order, skipping invisible ones. The framework default draw uses this; derived classes that override draw to add procedural visuals (background, decoration) or to wrap the loop in a clip view call this at the appropriate point.

void Panel::draw(target, states) const {
Rectangle::draw(target, states); // background
drawChildren(target, states); // children loop
}

◆ enableFlag() [1/3]

void ml::FlagManager< Flag >::enableFlag ( State state)
inherited

Set a flag to true.

Parameters
stateThe flag to enable.

◆ enableFlag() [2/3]

void ml::FlagManager< Flag >::enableFlag ( State state)
inherited

Set a flag to true.

Parameters
stateThe flag to enable.

◆ enableFlag() [3/3]

void ml::FlagManager< Flag >::enableFlag ( State state)
inherited

Set a flag to true.

Parameters
stateThe flag to enable.

◆ getChildren() [1/2]

const std::vector< Child > & ml::Core::getChildren ( ) const
inlineprotectedinherited

Read-only view of registered children, sorted by layer ascending. Within a layer, entries appear in registration order. Each Child carries its component pointer and layer key — derived classes that only care about the components walk entry.component.

Definition at line 299 of file Core.h.

◆ getChildren() [2/2]

const std::vector< Child > & ml::Core::getChildren ( ) const
inlineprotectedinherited

Read-only view of registered children, sorted by layer ascending. Within a layer, entries appear in registration order. Each Child carries its component pointer and layer key — derived classes that only care about the components walk entry.component.

Definition at line 299 of file Core.h.

◆ getGlobalBounds()

sf::FloatRect ml::Graphic< sf::Text >::getGlobalBounds ( ) const
overridevirtualinherited

Return the axis-aligned bounding box in world space.

Delegates to T::getGlobalBounds(). Used by AppManager for hit-testing (click, hover) and by layout helpers.

Returns
Bounding rectangle in world coordinates.

Reimplemented from ml::Positionable.

◆ getPosition()

sf::Vector2f ml::Graphic< sf::Text >::getPosition ( ) const
overridevirtualinherited

Return the current world-space position.

Delegates to T::getPosition.

Returns
Current position in world coordinates.

Reimplemented from ml::Positionable.

◆ getRenderStates() [1/2]

virtual sf::RenderStates ml::Core::getRenderStates ( ) const
inlinevirtualinherited

Definition at line 102 of file Core.h.

◆ getRenderStates() [2/2]

virtual sf::RenderStates ml::Core::getRenderStates ( ) const
inlinevirtualinherited

Definition at line 102 of file Core.h.

◆ getState() [1/2]

std::enable_if_t<!std::is_void_v< sf::Text >, sf::Text > ml::StateManager< extract_State< DraggableManifest >::type >::getState ( ) const
inherited

Return the current state value.

Returns
The active StateEnum value.

◆ getState() [2/2]

std::enable_if_t<!std::is_void_v< sf::Text >, sf::Text > ml::StateManager< extract_State< DraggableManifest >::type >::getState ( ) const
inherited

Return the current state value.

Returns
The active StateEnum value.

◆ Graphic() [1/2]

ml::Graphic< T >::Graphic ( )

◆ Graphic() [2/2]

template<typename U>
ml::Graphic< T >::Graphic ( const U & obj)
explicit

Construct from an existing SFML object of type U.

Template Parameters
USource type, must be compatible with T's copy/move constructor.
Parameters
objThe source object to copy-construct from.

◆ isEffectivelyVisible() [1/2]

bool ml::Core::isEffectivelyVisible ( ) const
inherited

True only if this component and every ancestor are visible.

isVisible() reports a single component's own HIDDEN flag, but visibility is not cascaded the way enabled-state is: hiding a container does not flip the HIDDEN flag on its descendants. A descendant of a hidden container is therefore not drawn (the parent never reaches it) yet still looks visible to anything that inspects its own flag — notably hit-testing. This walks the parent chain so such a descendant is correctly treated as not visible.

◆ isEffectivelyVisible() [2/2]

bool ml::Core::isEffectivelyVisible ( ) const
inherited

True only if this component and every ancestor are visible.

isVisible() reports a single component's own HIDDEN flag, but visibility is not cascaded the way enabled-state is: hiding a container does not flip the HIDDEN flag on its descendants. A descendant of a hidden container is therefore not drawn (the parent never reaches it) yet still looks visible to anything that inspects its own flag — notably hit-testing. This walks the parent chain so such a descendant is correctly treated as not visible.

◆ isEnabled() [1/2]

bool ml::Core::isEnabled ( ) const
inherited

◆ isEnabled() [2/2]

bool ml::Core::isEnabled ( ) const
inherited

◆ isScrolling() [1/2]

bool ml::Positionable::isScrolling ( )
inherited

Return true while a moveTo or moveDistance animation is in progress.

Returns
true if the waypoint queue is non-empty.

◆ isScrolling() [2/2]

bool ml::Positionable::isScrolling ( )
inherited

Return true while a moveTo or moveDistance animation is in progress.

Returns
true if the waypoint queue is non-empty.

◆ isState() [1/4]

std::enable_if_t<!std::is_void_v< T >, bool > ml::StateManager< extract_State< DraggableManifest >::type >::isState ( T state) const
inherited

Return true if currently in state.

Parameters
stateThe state value to compare against.
Returns
true if the current state equals state.

◆ isState() [2/4]

std::enable_if_t<!std::is_void_v< sf::Text >, bool > ml::StateManager< extract_State< DraggableManifest >::type >::isState ( sf::Text state) const
inherited

Return true if currently in state.

Parameters
stateThe state value to compare against.
Returns
true if the current state equals state.

◆ isState() [3/4]

std::enable_if_t<!std::is_void_v< sf::Text >, bool > ml::StateManager< extract_State< DraggableManifest >::type >::isState ( sf::Text state) const
inherited

Return true if currently in state.

Parameters
stateThe state value to compare against.
Returns
true if the current state equals state.

◆ isState() [4/4]

std::enable_if_t<!std::is_void_v< T >, bool > ml::StateManager< extract_State< DraggableManifest >::type >::isState ( T state) const
inherited

Return true if currently in state.

Parameters
stateThe state value to compare against.
Returns
true if the current state equals state.

◆ isVisible() [1/2]

bool ml::Core::isVisible ( ) const
inherited

◆ isVisible() [2/2]

bool ml::Core::isVisible ( ) const
inherited

◆ linkChild() [1/2]

void ml::Core::linkChild ( Core * parent,
Core * child )
staticinherited

◆ linkChild() [2/2]

void ml::Core::linkChild ( Core * parent,
Core * child )
staticinherited

◆ moveDistance() [1/2]

void ml::Positionable::moveDistance ( sf::Vector2f distance,
float seconds = 1.f )
inherited

Animate by a relative offset from the current position.

Equivalent to moveTo(getPosition() + distance, seconds).

Parameters
distanceOffset in world coordinates to move by.
secondsDuration of the animation. Defaults to 1.0 s.

◆ moveDistance() [2/2]

void ml::Positionable::moveDistance ( sf::Vector2f distance,
float seconds = 1.f )
inherited

Animate by a relative offset from the current position.

Equivalent to moveTo(getPosition() + distance, seconds).

Parameters
distanceOffset in world coordinates to move by.
secondsDuration of the animation. Defaults to 1.0 s.

◆ moveTo() [1/4]

void ml::Positionable::moveTo ( sf::FloatRect position,
float seconds = 1.f )
inherited

Animate to a position defined by a FloatRect origin.

Convenience overload that uses the top-left of position as the target. Useful when positioning relative to layout rects.

Parameters
positionRect whose origin is the animation target.
secondsDuration of the animation. Defaults to 1.0 s.

◆ moveTo() [2/4]

void ml::Positionable::moveTo ( sf::FloatRect position,
float seconds = 1.f )
inherited

Animate to a position defined by a FloatRect origin.

Convenience overload that uses the top-left of position as the target. Useful when positioning relative to layout rects.

Parameters
positionRect whose origin is the animation target.
secondsDuration of the animation. Defaults to 1.0 s.

◆ moveTo() [3/4]

void ml::Positionable::moveTo ( sf::Vector2f position,
float seconds = 1.f )
inherited

Animate to an absolute world-space position.

Populates an internal waypoint queue and advances through it on successive onUpdate ticks. The object's position at the start of the call is the implicit start point.

Parameters
positionTarget position in world coordinates.
secondsDuration of the animation. Defaults to 1.0 s.

◆ moveTo() [4/4]

void ml::Positionable::moveTo ( sf::Vector2f position,
float seconds = 1.f )
inherited

Animate to an absolute world-space position.

Populates an internal waypoint queue and advances through it on successive onUpdate ticks. The object's position at the start of the call is the implicit start point.

Parameters
positionTarget position in world coordinates.
secondsDuration of the animation. Defaults to 1.0 s.

◆ onBlur() [1/4]

void ml::Focusable::onBlur ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when this component loses keyboard focus.

Parameters
callbackFunction invoked with no arguments when focus is lost.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onBlur() [2/4]

void ml::Focusable::onBlur ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when this component loses keyboard focus.

Parameters
callbackFunction invoked with no arguments when focus is lost.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onBlur() [3/4]

void ml::Focusable::onBlur ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = true )
inherited

Register a callback invoked when this component loses keyboard focus, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event when focus is lost.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onBlur() [4/4]

void ml::Focusable::onBlur ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = true )
inherited

Register a callback invoked when this component loses keyboard focus, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event when focus is lost.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onClick() [1/4]

void ml::Clickable::onClick ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when this component is clicked.

Replaces any previously registered onClick callback. The callback fires after the mouse button is released over this component.

Parameters
callbackFunction invoked with no arguments on click.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onClick() [2/4]

void ml::Clickable::onClick ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when this component is clicked.

Replaces any previously registered onClick callback. The callback fires after the mouse button is released over this component.

Parameters
callbackFunction invoked with no arguments on click.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onClick() [3/4]

void ml::Clickable::onClick ( std::function< void(const std::optional< sf::Event > &event)> callback,
bool overwrite = true )
inherited

Register a callback invoked when this component is clicked, receiving the raw SFML event.

Replaces any previously registered onClick callback unless overwrite is false, in which case the callback is appended.

Parameters
callbackFunction invoked with the SFML event on click.
overwriteIf true (default), replaces any existing callback.

◆ onClick() [4/4]

void ml::Clickable::onClick ( std::function< void(const std::optional< sf::Event > &event)> callback,
bool overwrite = true )
inherited

Register a callback invoked when this component is clicked, receiving the raw SFML event.

Replaces any previously registered onClick callback unless overwrite is false, in which case the callback is appended.

Parameters
callbackFunction invoked with the SFML event on click.
overwriteIf true (default), replaces any existing callback.

◆ onEnabledChanged() [1/2]

virtual void ml::Core::onEnabledChanged ( bool enabled)
inlineprotectedvirtualinherited

THE hook for reacting to an enable/disable change. Fires whenever the effective enabled state flips — on both the direct (setEnabled) and cascade (setParentEnabled) paths — so visuals, hover/press state, popup teardown, etc. stay correct no matter how the change arrived. Override this instead of setEnabled/setParentEnabled.

Parameters
enabledthe new effective enabled state.

Definition at line 293 of file Core.h.

◆ onEnabledChanged() [2/2]

virtual void ml::Core::onEnabledChanged ( bool enabled)
inlineprotectedvirtualinherited

THE hook for reacting to an enable/disable change. Fires whenever the effective enabled state flips — on both the direct (setEnabled) and cascade (setParentEnabled) paths — so visuals, hover/press state, popup teardown, etc. stay correct no matter how the change arrived. Override this instead of setEnabled/setParentEnabled.

Parameters
enabledthe new effective enabled state.

Definition at line 293 of file Core.h.

◆ onFocus() [1/4]

void ml::Focusable::onFocus ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when this component gains keyboard focus.

Parameters
callbackFunction invoked with no arguments when focus is gained.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onFocus() [2/4]

void ml::Focusable::onFocus ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when this component gains keyboard focus.

Parameters
callbackFunction invoked with no arguments when focus is gained.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onFocus() [3/4]

void ml::Focusable::onFocus ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = true )
inherited

Register a callback invoked when this component gains keyboard focus, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event when focus is gained.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onFocus() [4/4]

void ml::Focusable::onFocus ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = true )
inherited

Register a callback invoked when this component gains keyboard focus, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event when focus is gained.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onHover() [1/4]

void ml::Hoverable::onHover ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when the mouse enters this component's bounds.

Parameters
callbackFunction invoked with no arguments on hover enter.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onHover() [2/4]

void ml::Hoverable::onHover ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when the mouse enters this component's bounds.

Parameters
callbackFunction invoked with no arguments on hover enter.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onHover() [3/4]

void ml::Hoverable::onHover ( std::function< void(const std::optional< sf::Event > &event)> callback,
bool overwrite = true )
inherited

Register a callback invoked when the mouse enters this component's bounds, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event on hover enter.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onHover() [4/4]

void ml::Hoverable::onHover ( std::function< void(const std::optional< sf::Event > &event)> callback,
bool overwrite = true )
inherited

Register a callback invoked when the mouse enters this component's bounds, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event on hover enter.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onKeypress() [1/4]

void ml::Keyable::onKeypress ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when a key is pressed while this component has focus.

Parameters
callbackFunction invoked with no arguments on key press.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onKeypress() [2/4]

void ml::Keyable::onKeypress ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when a key is pressed while this component has focus.

Parameters
callbackFunction invoked with no arguments on key press.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onKeypress() [3/4]

void ml::Keyable::onKeypress ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = true )
inherited

Register a callback invoked when a key is pressed while this component has focus, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event on key press.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onKeypress() [4/4]

void ml::Keyable::onKeypress ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = true )
inherited

Register a callback invoked when a key is pressed while this component has focus, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event on key press.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onKeyRelease() [1/4]

void ml::Keyable::onKeyRelease ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when a key is released while this component has focus.

Parameters
callbackFunction invoked with no arguments on key release.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onKeyRelease() [2/4]

void ml::Keyable::onKeyRelease ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when a key is released while this component has focus.

Parameters
callbackFunction invoked with no arguments on key release.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onKeyRelease() [3/4]

void ml::Keyable::onKeyRelease ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = true )
inherited

Register a callback invoked when a key is released while this component has focus, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event on key release.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onKeyRelease() [4/4]

void ml::Keyable::onKeyRelease ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = true )
inherited

Register a callback invoked when a key is released while this component has focus, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event on key release.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onMouseMoved() [1/4]

void ml::Scrollable::onMouseMoved ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked whenever the mouse moves anywhere in the window.

Unlike onHover, this fires for every component regardless of whether the cursor is over it.

Parameters
callbackFunction invoked with no arguments on mouse move.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onMouseMoved() [2/4]

void ml::Scrollable::onMouseMoved ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked whenever the mouse moves anywhere in the window.

Unlike onHover, this fires for every component regardless of whether the cursor is over it.

Parameters
callbackFunction invoked with no arguments on mouse move.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onMouseMoved() [3/4]

void ml::Scrollable::onMouseMoved ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = true )
inherited

Register a callback invoked whenever the mouse moves anywhere in the window, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event on mouse move.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onMouseMoved() [4/4]

void ml::Scrollable::onMouseMoved ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = true )
inherited

Register a callback invoked whenever the mouse moves anywhere in the window, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event on mouse move.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onMousePressed() [1/4]

void ml::Scrollable::onMousePressed ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when a mouse button is pressed anywhere in the window.

This fires before click logic is evaluated. Prefer onClick for standard click handling.

Parameters
callbackFunction invoked with no arguments on mouse press.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onMousePressed() [2/4]

void ml::Scrollable::onMousePressed ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when a mouse button is pressed anywhere in the window.

This fires before click logic is evaluated. Prefer onClick for standard click handling.

Parameters
callbackFunction invoked with no arguments on mouse press.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onMousePressed() [3/4]

void ml::Scrollable::onMousePressed ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = true )
inherited

Register a callback invoked when a mouse button is pressed, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event on mouse press.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onMousePressed() [4/4]

void ml::Scrollable::onMousePressed ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = true )
inherited

Register a callback invoked when a mouse button is pressed, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event on mouse press.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onMouseReleased() [1/4]

void ml::Scrollable::onMouseReleased ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when a mouse button is released anywhere in the window.

This fires before click logic is evaluated. Prefer onClick for standard click handling.

Parameters
callbackFunction invoked with no arguments on mouse release.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onMouseReleased() [2/4]

void ml::Scrollable::onMouseReleased ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when a mouse button is released anywhere in the window.

This fires before click logic is evaluated. Prefer onClick for standard click handling.

Parameters
callbackFunction invoked with no arguments on mouse release.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onMouseReleased() [3/4]

void ml::Scrollable::onMouseReleased ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = true )
inherited

Register a callback invoked when a mouse button is released, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event on mouse release.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onMouseReleased() [4/4]

void ml::Scrollable::onMouseReleased ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = true )
inherited

Register a callback invoked when a mouse button is released, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event on mouse release.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onScroll() [1/4]

void ml::Scrollable::onScroll ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when the mouse wheel is scrolled while the cursor is over this component.

Parameters
callbackFunction invoked with no arguments on scroll.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onScroll() [2/4]

void ml::Scrollable::onScroll ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when the mouse wheel is scrolled while the cursor is over this component.

Parameters
callbackFunction invoked with no arguments on scroll.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onScroll() [3/4]

void ml::Scrollable::onScroll ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = true )
inherited

Register a callback invoked when the mouse wheel is scrolled while the cursor is over this component, receiving the SFML event.

Parameters
callbackFunction invoked with the SFML event on scroll.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onScroll() [4/4]

void ml::Scrollable::onScroll ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = true )
inherited

Register a callback invoked when the mouse wheel is scrolled while the cursor is over this component, receiving the SFML event.

Parameters
callbackFunction invoked with the SFML event on scroll.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onStateEnter() [1/4]

std::enable_if_t<!std::is_void_v< T > > ml::StateManager< extract_State< DraggableManifest >::type >::onStateEnter ( std::function< void(T)> callback)
inherited

Register a callback invoked after each state transition.

The callback receives the newly entered state. Only one enter callback is active at a time; calling this again replaces it.

Parameters
callbackFunction called with the new state after each transition.

◆ onStateEnter() [2/4]

std::enable_if_t<!std::is_void_v< sf::Text > > ml::StateManager< extract_State< DraggableManifest >::type >::onStateEnter ( std::function< void(sf::Text)> callback)
inherited

Register a callback invoked after each state transition.

The callback receives the newly entered state. Only one enter callback is active at a time; calling this again replaces it.

Parameters
callbackFunction called with the new state after each transition.

◆ onStateEnter() [3/4]

std::enable_if_t<!std::is_void_v< sf::Text > > ml::StateManager< extract_State< DraggableManifest >::type >::onStateEnter ( std::function< void(sf::Text)> callback)
inherited

Register a callback invoked after each state transition.

The callback receives the newly entered state. Only one enter callback is active at a time; calling this again replaces it.

Parameters
callbackFunction called with the new state after each transition.

◆ onStateEnter() [4/4]

std::enable_if_t<!std::is_void_v< T > > ml::StateManager< extract_State< DraggableManifest >::type >::onStateEnter ( std::function< void(T)> callback)
inherited

Register a callback invoked after each state transition.

The callback receives the newly entered state. Only one enter callback is active at a time; calling this again replaces it.

Parameters
callbackFunction called with the new state after each transition.

◆ onStateExit() [1/4]

std::enable_if_t<!std::is_void_v< T > > ml::StateManager< extract_State< DraggableManifest >::type >::onStateExit ( std::function< void(T)> callback)
inherited

Register a callback invoked before each state transition.

The callback receives the state being left. Only one exit callback is active at a time; calling this again replaces it.

Parameters
callbackFunction called with the old state before each transition.

◆ onStateExit() [2/4]

std::enable_if_t<!std::is_void_v< sf::Text > > ml::StateManager< extract_State< DraggableManifest >::type >::onStateExit ( std::function< void(sf::Text)> callback)
inherited

Register a callback invoked before each state transition.

The callback receives the state being left. Only one exit callback is active at a time; calling this again replaces it.

Parameters
callbackFunction called with the old state before each transition.

◆ onStateExit() [3/4]

std::enable_if_t<!std::is_void_v< sf::Text > > ml::StateManager< extract_State< DraggableManifest >::type >::onStateExit ( std::function< void(sf::Text)> callback)
inherited

Register a callback invoked before each state transition.

The callback receives the state being left. Only one exit callback is active at a time; calling this again replaces it.

Parameters
callbackFunction called with the old state before each transition.

◆ onStateExit() [4/4]

std::enable_if_t<!std::is_void_v< T > > ml::StateManager< extract_State< DraggableManifest >::type >::onStateExit ( std::function< void(T)> callback)
inherited

Register a callback invoked before each state transition.

The callback receives the state being left. Only one exit callback is active at a time; calling this again replaces it.

Parameters
callbackFunction called with the old state before each transition.

◆ onTextEntered() [1/4]

void ml::Keyable::onTextEntered ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when a unicode character is entered while this component has focus.

Prefer onTextEntered over onKeypress for text input — it handles modifier keys, input method editors (IME), and non-ASCII characters correctly.

Parameters
callbackFunction invoked with no arguments when text is entered.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onTextEntered() [2/4]

void ml::Keyable::onTextEntered ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when a unicode character is entered while this component has focus.

Prefer onTextEntered over onKeypress for text input — it handles modifier keys, input method editors (IME), and non-ASCII characters correctly.

Parameters
callbackFunction invoked with no arguments when text is entered.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onTextEntered() [3/4]

void ml::Keyable::onTextEntered ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = true )
inherited

Register a callback invoked when a unicode character is entered while this component has focus, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event when text is entered.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onTextEntered() [4/4]

void ml::Keyable::onTextEntered ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = true )
inherited

Register a callback invoked when a unicode character is entered while this component has focus, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event when text is entered.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onUnhover() [1/4]

void ml::Hoverable::onUnhover ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when the mouse leaves this component's bounds.

Parameters
callbackFunction invoked with no arguments on hover leave.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onUnhover() [2/4]

void ml::Hoverable::onUnhover ( std::function< void()> callback,
bool overwrite = true )
inherited

Register a no-argument callback invoked when the mouse leaves this component's bounds.

Parameters
callbackFunction invoked with no arguments on hover leave.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onUnhover() [3/4]

void ml::Hoverable::onUnhover ( std::function< void(const std::optional< sf::Event > &event)> callback,
bool overwrite = true )
inherited

Register a callback invoked when the mouse leaves this component's bounds, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event on hover leave.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onUnhover() [4/4]

void ml::Hoverable::onUnhover ( std::function< void(const std::optional< sf::Event > &event)> callback,
bool overwrite = true )
inherited

Register a callback invoked when the mouse leaves this component's bounds, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event on hover leave.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onUpdate() [1/4]

void ml::Updatable::onUpdate ( std::function< void()> callback,
bool overwrite = false )
inherited

Register a no-argument callback invoked every frame.

The callback fires once per frame before the draw pass. All active components receive this regardless of hover or focus state.

Parameters
callbackFunction invoked with no arguments each frame.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onUpdate() [2/4]

void ml::Updatable::onUpdate ( std::function< void()> callback,
bool overwrite = false )
inherited

Register a no-argument callback invoked every frame.

The callback fires once per frame before the draw pass. All active components receive this regardless of hover or focus state.

Parameters
callbackFunction invoked with no arguments each frame.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onUpdate() [3/4]

void ml::Updatable::onUpdate ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = false )
inherited

Register a callback invoked every frame, receiving the SFML event.

For frame events the std::optional<sf::Event> is always std::nullopt — use the no-argument overload unless you specifically need the optional parameter in your callback signature.

Parameters
callbackFunction invoked with the SFML event (always nullopt) each frame.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onUpdate() [4/4]

void ml::Updatable::onUpdate ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = false )
inherited

Register a callback invoked every frame, receiving the SFML event.

For frame events the std::optional<sf::Event> is always std::nullopt — use the no-argument overload unless you specifically need the optional parameter in your callback signature.

Parameters
callbackFunction invoked with the SFML event (always nullopt) each frame.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onWindowFocusGained() [1/4]

void ml::Updatable::onWindowFocusGained ( std::function< void()> callback,
bool overwrite = false )
inherited

Register a no-argument callback invoked when the application window gains OS focus.

Parameters
callbackFunction invoked with no arguments when focus is gained.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onWindowFocusGained() [2/4]

void ml::Updatable::onWindowFocusGained ( std::function< void()> callback,
bool overwrite = false )
inherited

Register a no-argument callback invoked when the application window gains OS focus.

Parameters
callbackFunction invoked with no arguments when focus is gained.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onWindowFocusGained() [3/4]

void ml::Updatable::onWindowFocusGained ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = false )
inherited

Register a callback invoked when the application window gains OS focus, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event when focus is gained.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onWindowFocusGained() [4/4]

void ml::Updatable::onWindowFocusGained ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = false )
inherited

Register a callback invoked when the application window gains OS focus, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event when focus is gained.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onWindowFocusLost() [1/4]

void ml::Updatable::onWindowFocusLost ( std::function< void()> callback,
bool overwrite = false )
inherited

Register a no-argument callback invoked when the application window loses OS focus.

Parameters
callbackFunction invoked with no arguments when focus is lost.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onWindowFocusLost() [2/4]

void ml::Updatable::onWindowFocusLost ( std::function< void()> callback,
bool overwrite = false )
inherited

Register a no-argument callback invoked when the application window loses OS focus.

Parameters
callbackFunction invoked with no arguments when focus is lost.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onWindowFocusLost() [3/4]

void ml::Updatable::onWindowFocusLost ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = false )
inherited

Register a callback invoked when the application window loses OS focus, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event when focus is lost.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onWindowFocusLost() [4/4]

void ml::Updatable::onWindowFocusLost ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = false )
inherited

Register a callback invoked when the application window loses OS focus, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event when focus is lost.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onWindowResize() [1/2]

virtual void ml::Core::onWindowResize ( unsigned int ,
unsigned int  )
inlinevirtualinherited

Called by AppManager on every registered component when the window is resized. Override in responsive components to reflow to the new pixel size (the framework keeps a 1:1 view, so width/height are window pixels).

Definition at line 135 of file Core.h.

◆ onWindowResize() [2/2]

virtual void ml::Core::onWindowResize ( unsigned int ,
unsigned int  )
inlinevirtualinherited

Called by AppManager on every registered component when the window is resized. Override in responsive components to reflow to the new pixel size (the framework keeps a 1:1 view, so width/height are window pixels).

Definition at line 135 of file Core.h.

◆ onWindowResized() [1/4]

void ml::Updatable::onWindowResized ( std::function< void()> callback,
bool overwrite = false )
inherited

Register a no-argument callback invoked when the application window is resized.

Parameters
callbackFunction invoked with no arguments on window resize.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onWindowResized() [2/4]

void ml::Updatable::onWindowResized ( std::function< void()> callback,
bool overwrite = false )
inherited

Register a no-argument callback invoked when the application window is resized.

Parameters
callbackFunction invoked with no arguments on window resize.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onWindowResized() [3/4]

void ml::Updatable::onWindowResized ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = false )
inherited

Register a callback invoked when the application window is resized, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event on window resize.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ onWindowResized() [4/4]

void ml::Updatable::onWindowResized ( std::function< void(const std::optional< sf::Event > &)> callback,
bool overwrite = false )
inherited

Register a callback invoked when the application window is resized, receiving the raw SFML event.

Parameters
callbackFunction invoked with the SFML event on window resize.
overwriteWhen true, replaces any existing callback; when false, appends an additional one.

◆ operator const sf::Drawable &()

ml::Graphic< sf::Text >::operator const sf::Drawable & ( ) const
inherited

Implicit conversion to a const sf::Drawable reference.

Allows a Graphic to be passed wherever a raw sf::Drawable& is expected (e.g., window.draw()).

Returns
Const reference to this object as sf::Drawable.

◆ process() [1/6]

virtual void ml::EventReceiver::process ( const std::string & key,
const std::optional< sf::Event > & event )
virtualinherited

Invoke all callbacks registered for key.

Called by framework dispatchers. key is the string produced by EnumKey::get(eventEnum).

Parameters
keyString key identifying the event.
eventSFML event forwarded to each callback.

◆ process() [2/6]

virtual void ml::EventReceiver::process ( const std::string & key,
const std::optional< sf::Event > & event )
virtualinherited

Invoke all callbacks registered for key.

Called by framework dispatchers. key is the string produced by EnumKey::get(eventEnum).

Parameters
keyString key identifying the event.
eventSFML event forwarded to each callback.

◆ process() [3/6]

void ml::EventReceiver::process ( ENUM_TYPE eventName,
const std::optional< sf::Event > & event )
inherited

Invoke all callbacks registered for eventName.

Template overload that accepts any enum value directly, converting to a string key via EnumKey::get() internally.

Template Parameters
ENUM_TYPEAny enum type.
Parameters
eventNameThe enum value identifying the event.
eventSFML event forwarded to each callback.

◆ process() [4/6]

void ml::EventReceiver::process ( ENUM_TYPE eventName,
const std::optional< sf::Event > & event )
inherited

Invoke all callbacks registered for eventName.

Template overload that accepts any enum value directly, converting to a string key via EnumKey::get() internally.

Template Parameters
ENUM_TYPEAny enum type.
Parameters
eventNameThe enum value identifying the event.
eventSFML event forwarded to each callback.

◆ process() [5/6]

void ml::EventReceiver::process ( ENUM_TYPE eventName,
const std::optional< sf::Event > & event )
inherited

Invoke all callbacks registered for eventName.

Template overload that accepts any enum value directly, converting to a string key via EnumKey::get() internally.

Template Parameters
ENUM_TYPEAny enum type.
Parameters
eventNameThe enum value identifying the event.
eventSFML event forwarded to each callback.

◆ process() [6/6]

void ml::EventReceiver::process ( ENUM_TYPE eventName,
const std::optional< sf::Event > & event )
inherited

Invoke all callbacks registered for eventName.

Template overload that accepts any enum value directly, converting to a string key via EnumKey::get() internally.

Template Parameters
ENUM_TYPEAny enum type.
Parameters
eventNameThe enum value identifying the event.
eventSFML event forwarded to each callback.

◆ publish() [1/2]

void ml::Subscribable::publish ( ENUM_TYPE event,
FilterCallback filter = [](EventReceiver&){ return true; },
SystemCallback resolve = nullptr,
SystemCallback reject = nullptr )
inherited

Fire an enum-keyed event to all matching subscribers.

Iterates all subscribers registered for event and invokes their callbacks for each subscriber that passes the optional filter. Optional resolve and reject system callbacks are called after each component passes or fails the filter respectively.

Template Parameters
ENUM_TYPEAny enum type.
Parameters
eventThe enum value identifying the event to fire.
filterOptional predicate; only subscribers for which this returns true receive the event. Defaults to accepting all subscribers.
resolveOptional callback invoked for each subscriber that passes the filter.
rejectOptional callback invoked for each subscriber that fails the filter.

◆ publish() [2/2]

void ml::Subscribable::publish ( ENUM_TYPE event,
FilterCallback filter = [](EventReceiver&){ return true; },
SystemCallback resolve = nullptr,
SystemCallback reject = nullptr )
inherited

Fire an enum-keyed event to all matching subscribers.

Iterates all subscribers registered for event and invokes their callbacks for each subscriber that passes the optional filter. Optional resolve and reject system callbacks are called after each component passes or fails the filter respectively.

Template Parameters
ENUM_TYPEAny enum type.
Parameters
eventThe enum value identifying the event to fire.
filterOptional predicate; only subscribers for which this returns true receive the event. Defaults to accepting all subscribers.
resolveOptional callback invoked for each subscriber that passes the filter.
rejectOptional callback invoked for each subscriber that fails the filter.

◆ removeComponent() [1/2]

void ml::Core::removeComponent ( Core & child)
inherited

◆ removeComponent() [2/2]

void ml::Core::removeComponent ( Core & child)
inherited

◆ setAbove() [1/4]

void ml::Positionable::setAbove ( T & obj,
float spacing = 0 )
inherited

Position this object immediately above obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objReference object.
spacingGap in pixels between the two objects. Defaults to 0.

◆ setAbove() [2/4]

void ml::Positionable::setAbove ( sf::Text & obj,
float spacing = 0 )
inherited

Position this object immediately above obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objReference object.
spacingGap in pixels between the two objects. Defaults to 0.

◆ setAbove() [3/4]

void ml::Positionable::setAbove ( sf::Text & obj,
float spacing = 0 )
inherited

Position this object immediately above obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objReference object.
spacingGap in pixels between the two objects. Defaults to 0.

◆ setAbove() [4/4]

template<class T>
void ml::Positionable::setAbove ( T & obj,
float spacing = 0 )
inherited

Position this object immediately above obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objReference object.
spacingGap in pixels between the two objects. Defaults to 0.

◆ setActive() [1/2]

virtual void ml::Core::setActive ( bool active)
virtualinherited

◆ setActive() [2/2]

virtual void ml::Core::setActive ( bool active)
virtualinherited

◆ setBelow() [1/4]

void ml::Positionable::setBelow ( T & obj,
float spacing = 0 )
inherited

Position this object immediately below obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objReference object.
spacingGap in pixels between the two objects. Defaults to 0.

◆ setBelow() [2/4]

void ml::Positionable::setBelow ( sf::Text & obj,
float spacing = 0 )
inherited

Position this object immediately below obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objReference object.
spacingGap in pixels between the two objects. Defaults to 0.

◆ setBelow() [3/4]

void ml::Positionable::setBelow ( sf::Text & obj,
float spacing = 0 )
inherited

Position this object immediately below obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objReference object.
spacingGap in pixels between the two objects. Defaults to 0.

◆ setBelow() [4/4]

template<class T>
void ml::Positionable::setBelow ( T & obj,
float spacing = 0 )
inherited

Position this object immediately below obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objReference object.
spacingGap in pixels between the two objects. Defaults to 0.

◆ setDragBounds() [1/2]

void ml::Draggable::setDragBounds ( const sf::FloatRect & bounds)
inherited

Constrain drag movement to an axis-aligned bounding rectangle.

While bounds are set, the component's position is clamped so that its top-left corner never moves outside bounds during a drag gesture. Bounds are applied in world coordinates.

Call clearDragBounds() to remove the constraint and allow free movement again.

Parameters
boundsThe world-space rectangle within which the component may be dragged.

◆ setDragBounds() [2/2]

void ml::Draggable::setDragBounds ( const sf::FloatRect & bounds)
inherited

Constrain drag movement to an axis-aligned bounding rectangle.

While bounds are set, the component's position is clamped so that its top-left corner never moves outside bounds during a drag gesture. Bounds are applied in world coordinates.

Call clearDragBounds() to remove the constraint and allow free movement again.

Parameters
boundsThe world-space rectangle within which the component may be dragged.

◆ setEnabled() [1/2]

void ml::Core::setEnabled ( bool enabled)
inherited

Set this component's own enabled intent (_selfEnabled). Public API and non-virtual: there is exactly one enable mechanism. To react to an enable/disable change, override onEnabledChanged — never this.

◆ setEnabled() [2/2]

void ml::Core::setEnabled ( bool enabled)
inherited

Set this component's own enabled intent (_selfEnabled). Public API and non-virtual: there is exactly one enable mechanism. To react to an enable/disable change, override onEnabledChanged — never this.

◆ setFlag() [1/3]

void ml::FlagManager< Flag >::setFlag ( State state,
bool status )
inherited

Set a flag to an explicit value.

Parameters
stateThe flag to modify.
statustrue to enable, false to disable.

◆ setFlag() [2/3]

void ml::FlagManager< Flag >::setFlag ( State state,
bool status )
inherited

Set a flag to an explicit value.

Parameters
stateThe flag to modify.
statustrue to enable, false to disable.

◆ setFlag() [3/3]

void ml::FlagManager< Flag >::setFlag ( State state,
bool status )
inherited

Set a flag to an explicit value.

Parameters
stateThe flag to modify.
statustrue to enable, false to disable.

◆ setFramerate() [1/2]

void ml::Positionable::setFramerate ( float framerate)
inherited

Set the assumed framerate for movement interpolation.

moveTo generates a queue of intermediate positions based on this value. Defaults to 60 fps. Call this if your application runs at a different target rate to keep animation timing accurate.

Parameters
framerateTarget framerate in frames per second.

◆ setFramerate() [2/2]

void ml::Positionable::setFramerate ( float framerate)
inherited

Set the assumed framerate for movement interpolation.

moveTo generates a queue of intermediate positions based on this value. Defaults to 60 fps. Call this if your application runs at a different target rate to keep animation timing accurate.

Parameters
framerateTarget framerate in frames per second.

◆ setLeftOf() [1/4]

void ml::Positionable::setLeftOf ( T & obj,
float spacing = 0 )
inherited

Position this object immediately to the left of obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objReference object.
spacingGap in pixels between the two objects. Defaults to 0.

◆ setLeftOf() [2/4]

void ml::Positionable::setLeftOf ( sf::Text & obj,
float spacing = 0 )
inherited

Position this object immediately to the left of obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objReference object.
spacingGap in pixels between the two objects. Defaults to 0.

◆ setLeftOf() [3/4]

void ml::Positionable::setLeftOf ( sf::Text & obj,
float spacing = 0 )
inherited

Position this object immediately to the left of obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objReference object.
spacingGap in pixels between the two objects. Defaults to 0.

◆ setLeftOf() [4/4]

template<class T>
void ml::Positionable::setLeftOf ( T & obj,
float spacing = 0 )
inherited

Position this object immediately to the left of obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objReference object.
spacingGap in pixels between the two objects. Defaults to 0.

◆ setParentEnabled() [1/2]

void ml::Core::setParentEnabled ( bool enabled)
inherited

Cascade plumbing: set the inherited (_parentEnabled) component of the effective state. Called by the framework when an ancestor's effective state changes (and by Modal/Panel for explicit subtree gating). NOT an override point — react via onEnabledChanged instead.

◆ setParentEnabled() [2/2]

void ml::Core::setParentEnabled ( bool enabled)
inherited

Cascade plumbing: set the inherited (_parentEnabled) component of the effective state. Called by the framework when an ancestor's effective state changes (and by Modal/Panel for explicit subtree gating). NOT an override point — react via onEnabledChanged instead.

◆ setPosition()

void ml::Graphic< sf::Text >::setPosition ( const sf::Vector2f & position)
overridevirtualinherited

Set the world-space position.

Delegates to T::setPosition.

Parameters
positionNew position in world coordinates.

Reimplemented from ml::Positionable.

◆ setRightOf() [1/4]

void ml::Positionable::setRightOf ( T & obj,
float spacing = 0 )
inherited

Position this object immediately to the right of obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objReference object.
spacingGap in pixels between the two objects. Defaults to 0.

◆ setRightOf() [2/4]

void ml::Positionable::setRightOf ( sf::Text & obj,
float spacing = 0 )
inherited

Position this object immediately to the right of obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objReference object.
spacingGap in pixels between the two objects. Defaults to 0.

◆ setRightOf() [3/4]

void ml::Positionable::setRightOf ( sf::Text & obj,
float spacing = 0 )
inherited

Position this object immediately to the right of obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objReference object.
spacingGap in pixels between the two objects. Defaults to 0.

◆ setRightOf() [4/4]

template<class T>
void ml::Positionable::setRightOf ( T & obj,
float spacing = 0 )
inherited

Position this object immediately to the right of obj.

Template Parameters
TAny type with getGlobalBounds().
Parameters
objReference object.
spacingGap in pixels between the two objects. Defaults to 0.

◆ setState() [1/4]

std::enable_if_t<!std::is_void_v< T > > ml::StateManager< extract_State< DraggableManifest >::type >::setState ( T newState)
inherited

Transition to a new state.

Fires the exit callback with the current state, updates the stored state to newState, then fires the enter callback with the new state. Either callback may be unset (nullptr), in which case it is skipped.

Parameters
newStateThe state to transition into.

◆ setState() [2/4]

std::enable_if_t<!std::is_void_v< sf::Text > > ml::StateManager< extract_State< DraggableManifest >::type >::setState ( sf::Text newState)
inherited

Transition to a new state.

Fires the exit callback with the current state, updates the stored state to newState, then fires the enter callback with the new state. Either callback may be unset (nullptr), in which case it is skipped.

Parameters
newStateThe state to transition into.

◆ setState() [3/4]

std::enable_if_t<!std::is_void_v< sf::Text > > ml::StateManager< extract_State< DraggableManifest >::type >::setState ( sf::Text newState)
inherited

Transition to a new state.

Fires the exit callback with the current state, updates the stored state to newState, then fires the enter callback with the new state. Either callback may be unset (nullptr), in which case it is skipped.

Parameters
newStateThe state to transition into.

◆ setState() [4/4]

std::enable_if_t<!std::is_void_v< T > > ml::StateManager< extract_State< DraggableManifest >::type >::setState ( T newState)
inherited

Transition to a new state.

Fires the exit callback with the current state, updates the stored state to newState, then fires the enter callback with the new state. Either callback may be unset (nullptr), in which case it is skipped.

Parameters
newStateThe state to transition into.

◆ setVisible() [1/2]

virtual void ml::Core::setVisible ( bool visible)
virtualinherited

◆ setVisible() [2/2]

virtual void ml::Core::setVisible ( bool visible)
virtualinherited

◆ subscribe() [1/4]

void ml::Subscribable::subscribe ( ENUM_TYPE event,
Callback callback )
inherited

Subscribe to an enum-keyed event with a no-argument callback.

Convenience overload for callbacks that do not need access to the raw SFML event.

Template Parameters
ENUM_TYPEAny enum type.
Parameters
eventThe enum value identifying the event to subscribe to.
callbackFunction invoked with no arguments when the event fires.

◆ subscribe() [2/4]

void ml::Subscribable::subscribe ( ENUM_TYPE event,
Callback callback )
inherited

Subscribe to an enum-keyed event with a no-argument callback.

Convenience overload for callbacks that do not need access to the raw SFML event.

Template Parameters
ENUM_TYPEAny enum type.
Parameters
eventThe enum value identifying the event to subscribe to.
callbackFunction invoked with no arguments when the event fires.

◆ subscribe() [3/4]

void ml::Subscribable::subscribe ( ENUM_TYPE event,
EventCallback callback )
inherited

Subscribe to an enum-keyed event with a full SFML event callback.

The callback is invoked each time the event fires and the framework's filter (defined by the associated EventDispatcher) passes this component. The std::optional<sf::Event> parameter carries the raw SFML event when one is available, or std::nullopt for frame events.

Template Parameters
ENUM_TYPEAny enum type — ml::Event for built-in events, or a manifest event enum for custom events.
Parameters
eventThe enum value identifying the event to subscribe to.
callbackFunction invoked with the SFML event when the event fires.

◆ subscribe() [4/4]

void ml::Subscribable::subscribe ( ENUM_TYPE event,
EventCallback callback )
inherited

Subscribe to an enum-keyed event with a full SFML event callback.

The callback is invoked each time the event fires and the framework's filter (defined by the associated EventDispatcher) passes this component. The std::optional<sf::Event> parameter carries the raw SFML event when one is available, or std::nullopt for frame events.

Template Parameters
ENUM_TYPEAny enum type — ml::Event for built-in events, or a manifest event enum for custom events.
Parameters
eventThe enum value identifying the event to subscribe to.
callbackFunction invoked with the SFML event when the event fires.

◆ toggleFlag() [1/3]

void ml::FlagManager< Flag >::toggleFlag ( State state)
inherited

Flip a flag between true and false.

Parameters
stateThe flag to toggle.

◆ toggleFlag() [2/3]

void ml::FlagManager< Flag >::toggleFlag ( State state)
inherited

Flip a flag between true and false.

Parameters
stateThe flag to toggle.

◆ toggleFlag() [3/3]

void ml::FlagManager< Flag >::toggleFlag ( State state)
inherited

Flip a flag between true and false.

Parameters
stateThe flag to toggle.

◆ topmostMatching() [1/2]

Core * ml::Core::topmostMatching ( const std::function< bool(Core &)> & accept)
inherited

Find the front-most (last-painted) node in this subtree that satisfies accept, searching topmost-first.

Walks this Core and its descendants in reverse paint order — children before their parent, and within a parent the highest layer first — so the first node for which accept returns true is the one visually on top at that location. Invisible subtrees are skipped.

This is the hit-testing seam the event system uses to route a click to only the top-most interactive target instead of every overlapping one. accept encapsulates the test (e.g. "is hovered AND a click target"), keeping Core free of any geometry/bounds knowledge.

Parameters
acceptPredicate evaluated per node, topmost-first.
Returns
The front-most accepted node, or nullptr if none match.

◆ topmostMatching() [2/2]

Core * ml::Core::topmostMatching ( const std::function< bool(Core &)> & accept)
inherited

Find the front-most (last-painted) node in this subtree that satisfies accept, searching topmost-first.

Walks this Core and its descendants in reverse paint order — children before their parent, and within a parent the highest layer first — so the first node for which accept returns true is the one visually on top at that location. Invisible subtrees are skipped.

This is the hit-testing seam the event system uses to route a click to only the top-most interactive target instead of every overlapping one. accept encapsulates the test (e.g. "is hovered AND a click target"), keeping Core free of any geometry/bounds knowledge.

Parameters
acceptPredicate evaluated per node, topmost-first.
Returns
The front-most accepted node, or nullptr if none match.

◆ unlinkAll() [1/2]

void ml::Core::unlinkAll ( Core * core)
staticinherited

◆ unlinkAll() [2/2]

void ml::Core::unlinkAll ( Core * core)
staticinherited

◆ unsubscribe() [1/2]

void ml::Unsubscribable::unsubscribe ( EnumType event)
inlineinherited

Unsubscribe from a single event by enum value.

Works with any enum type — ml::Event for built-in events, or a manifest Event enum for custom events.

If called during an EventManager::fire() iteration the removal is deferred until the iteration completes.

Template Parameters
EnumTypeAny enum type. Enforced at compile time.
Parameters
eventThe enum value identifying the event to remove.

Definition at line 65 of file Unsubscribable.h.

◆ unsubscribe() [2/2]

void ml::Unsubscribable::unsubscribe ( EnumType event)
inlineinherited

Unsubscribe from a single event by enum value.

Works with any enum type — ml::Event for built-in events, or a manifest Event enum for custom events.

If called during an EventManager::fire() iteration the removal is deferred until the iteration completes.

Template Parameters
EnumTypeAny enum type. Enforced at compile time.
Parameters
eventThe enum value identifying the event to remove.

Definition at line 65 of file Unsubscribable.h.

◆ unsubscribeAll() [1/2]

Remove all event subscriptions for this component.

Removes every subscription registered across all event names. Called automatically by Core's destructor.

If called during an EventManager::fire() iteration the removal is deferred until the iteration completes.

◆ unsubscribeAll() [2/2]

Remove all event subscriptions for this component.

Removes every subscription registered across all event names. Called automatically by Core's destructor.

If called during an EventManager::fire() iteration the removal is deferred until the iteration completes.

Member Data Documentation

◆ DefaultLayer [1/2]

int ml::Core::DefaultLayer
staticconstexprinherited

Default layer key when none is specified. Chosen at 100 so callers can place children both above and below the default without renumbering. Within a layer, children draw in registration order.

Definition at line 155 of file Core.h.

◆ DefaultLayer [2/2]

int ml::Core::DefaultLayer
staticconstexprinherited

Default layer key when none is specified. Chosen at 100 so callers can place children both above and below the default without renumbering. Within a layer, children draw in registration order.

Definition at line 155 of file Core.h.


The documentation for this class was generated from the following file: