Loading...
Searching...
No Matches

Shared helper types and utility functions used across the framework. More...

Collaboration diagram for Utilities:

Files

file  EnumClassHash.h
file  Helper.h
file  LoaderFunctions.h
file  TypeExtraction.h

Classes

class  ml::Align
 Static layout helpers for positioning objects relative to one another. More...
struct  ml::EnumKey
 Utility for generating unique, stable string keys from enum values. More...
class  ml::Helper
 Static debug helpers for printing SFML value types. More...
class  ml::ImageRects
 A grid-indexed collection of sf::IntRect regions. More...
class  ml::MouseEvents
 Static helpers for mouse hit-testing against framework objects. More...
class  ml::ShaderLibrary
 Built-in GLSL shaders and uniform parameters for Carousel effects. More...
class  ml::TextManipulators
 Static helpers for text layout and string manipulation. More...
class  ml::TextureSlicer
 Divides a texture into a uniform grid of sub-rectangles. More...

Enumerations

enum class  ml::Flag {
  ml::Flag::HOVERED , ml::Flag::CLICKED , ml::Flag::HIDDEN , ml::Flag::BLINKING ,
  ml::Flag::FOCUSED , ml::Flag::ENABLED , ml::Flag::DRAGGABLE , ml::Flag::DRAGGING ,
  ml::Flag::VERTICAL , ml::Flag::HORIZONTAL , ml::Flag::LAST_FLAG
}
 System-level boolean flags available on every ml::Core object. More...
enum  ml::Tween { ml::LINEAR , ml::EXPONENTIAL , ml::LAST_TWEEN }
 Easing curve selection for animated movement. More...

Detailed Description

Shared helper types and utility functions used across the framework.

Enumeration Type Documentation

◆ Flag

enum class ml::Flag
strong

System-level boolean flags available on every ml::Core object.

ml::Flag is the enum type managed by FlagManager<ml::Flag>, which is inherited by every Core object through the Flaggable trait. Framework subsystems read and write these flags automatically; user code can query and set them to control built-in behavior.

Framework-managed flags

These are set and cleared by the framework — read them freely, but be careful about writing them manually:

Flag Set by Meaning
HOVERED HoverableDispatcher Mouse is currently over this component
CLICKED ClickableDispatcher Mouse button is currently held down over this component
FOCUSED ClickableDispatcher Component has keyboard focus
DRAGGING DraggableDispatcher A drag gesture is currently in progress

User-controlled flags

Set these to enable or configure built-in framework behavior:

Flag Effect when set
DRAGGABLE Enables mouse-drag handling in ComponentCore
HIDDEN Conventionally marks a component as not drawn (implementation-dependent)
BLINKING Conventionally marks a component for blink animation
ENABLED Conventionally marks a component as active/interactive
VERTICAL Hints a layout or scrollable to operate on the vertical axis
HORIZONTAL Hints a layout or scrollable to operate on the horizontal axis

Usage

// Enable dragging
myComponent.setFlag(ml::Flag::DRAGGABLE);
// Check hover state
if (myComponent.checkFlag(ml::Flag::HOVERED)) { ... }
// Hide a component
myComponent.setFlag(ml::Flag::HIDDEN);
@ HIDDEN
Component should not be drawn.
Definition Flag.h:63
@ HOVERED
Mouse is currently over this component (set by HoverableDispatcher).
Definition Flag.h:61
@ DRAGGABLE
Enables drag handling in ComponentCore.
Definition Flag.h:67
Note
LAST_FLAG is a sentinel value used for iteration and array sizing. Do not use it as an actual flag.
See also
FlagManager, Flaggable, Draggable
Enumerator
HOVERED 

Mouse is currently over this component (set by HoverableDispatcher).

CLICKED 

Mouse button is held down over this component (set by ClickableDispatcher).

HIDDEN 

Component should not be drawn.

BLINKING 

Component is in a blink animation cycle.

FOCUSED 

Component has keyboard focus (set by ClickableDispatcher).

ENABLED 

Component is active and interactive.

DRAGGABLE 

Enables drag handling in ComponentCore.

DRAGGING 

A drag gesture is currently in progress (set by DraggableDispatcher).

VERTICAL 

Layout/scroll axis hint: vertical.

HORIZONTAL 

Layout/scroll axis hint: horizontal.

LAST_FLAG 

Sentinel — do not use as an actual flag value.

Definition at line 59 of file Flag.h.

◆ Tween

enum ml::Tween

Easing curve selection for animated movement.

Tween is passed to Positionable::moveTo and related animation methods to control how intermediate positions are interpolated between the start and end points.

Value Curve
LINEAR Constant speed from start to end
EXPONENTIAL Starts fast and decelerates toward the target

Usage

// Animate with default linear easing
myComponent.moveTo({400.f, 300.f}, 0.5f);
// Animate with exponential ease-out
myComponent.moveTo({400.f, 300.f}, 0.5f, ml::EXPONENTIAL);
@ EXPONENTIAL
Decelerating interpolation (ease-out).
Definition Tween.h:42
Note
LAST_TWEEN is a sentinel value used for bounds checking. Do not pass it as an actual easing curve.
See also
Positionable
Enumerator
LINEAR 

Constant-speed interpolation.

EXPONENTIAL 

Decelerating interpolation (ease-out).

LAST_TWEEN 

Sentinel — do not use as an actual tween value.

Definition at line 39 of file Tween.h.