Velvet 0.1a
A beginner-friendly C++ GUI framework built on SFML.
Loading...
Searching...
No Matches
HStack Class Reference

Horizontal stack helper (StackDirection::Horizontal). More...

#include <Stack.hpp>

+ Inheritance diagram for HStack:

Public Member Functions

 HStack (float gap=0)
 
- Public Member Functions inherited from Stack
 Stack (StackDirection dir, float gap=0)
 Construct a stack with direction and optional gap.
 
void render (sf::RenderWindow &window) override
 Render stack background and child widgets.
 
void add (Widget *widget)
 Add a child widget pointer.
 
template<typename... Ts>
void add (Ts &&... widgets)
 Add one or more child widgets (pointer or reference forms).
 
void setPosition (float x, float y) override
 Set stack position (top-left).
 
sf::Vector2f getDimensions () override
 Get total stack dimensions including padding.
 
void handleEvent (const sf::Event &event, sf::RenderWindow &window) override
 Forward input events to all children.
 
void setGap (float g)
 Set spacing between children.
 
float getGap () const
 Get current child gap.
 
void setJustifyContent (StackJustify value)
 Set main-axis content alignment.
 
void setJustifyContent (const std::string &value)
 Set main-axis alignment from string (start|center|end).
 
void setAlignItems (StackAlign value)
 Set cross-axis child alignment.
 
void setAlignItems (const std::string &value)
 Set cross-axis alignment from string (start|center|end).
 
void setSize (float width, float height)
 Set explicit content size used for alignment calculations.
 
void setWidth (float width)
 Set explicit content width.
 
void setHeight (float height)
 Set explicit content height.
 
void setPadding (float p)
 Set uniform padding on all sides.
 
void setPadding (float horizontal, float vertical)
 Set horizontal and vertical padding.
 
void setPadding (float left, float right, float top, float bottom)
 Set side-specific padding.
 
void setBackgroundColor (sf::Color color)
 Set container background color.
 
- Public Member Functions inherited from Widget
 Widget ()
 Construct a widget with default font loading.
 

Additional Inherited Members

- Public Attributes inherited from Widget
sf::Font font
 Shared font loaded by the base widget.
 
- Protected Attributes inherited from Widget
float x
 
float y
 

Detailed Description

Horizontal stack helper (StackDirection::Horizontal).

Constructor & Destructor Documentation

◆ HStack()

HStack::HStack ( float  gap = 0)
inline

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