wPlot2D version: 0.1.0
A lightweight C++ library for clear and customizable 2D scientific plots.
Loading...
Searching...
No Matches
wEngine::PaddingComponent Class Reference

ECS component representing internal padding for UI-like elements. More...

#include <wPaddingComponent.hpp>

Inheritance diagram for wEngine::PaddingComponent:
Inheritance graph

Public Member Functions

 PaddingComponent (sf::Vector2f padding=sf::Vector2f(0.0f, 0.0f))
 Constructs a PaddingComponent with optional initial padding.
virtual ~PaddingComponent ()=default
void setPadding (sf::Vector2f padding)
 Sets the padding vector.
sf::Vector2f getPadding () const
 Returns the current padding values.
void debugPrint () const
 Prints the current padding values to standard output for debugging.
Public Member Functions inherited from wEngine::Component
virtual ~Component ()=default
virtual void enable ()
virtual void disable ()
bool isEnabled () const
 Checks whether the component is currently active.
void setParent (Entity *parent)
 Sets the parent entity of this component.
EntitygetParent () const
 Returns the parent entity of this component.

Additional Inherited Members

Protected Member Functions inherited from wEngine::Component
 Component ()
 Protected constructor to restrict instantiation to derived classes.

Detailed Description

ECS component representing internal padding for UI-like elements.

This component encapsulates a 2D padding vector (horizontal and vertical) that can be used to add internal spacing between a visual element (e.g., a title or a frame) and its boundary.

Padding Convention:

  • x corresponds to horizontal padding (left and right),
  • y corresponds to vertical padding (top and bottom).
Author
Wilfried Koch

Constructor & Destructor Documentation

◆ PaddingComponent()

wEngine::PaddingComponent::PaddingComponent ( sf::Vector2f padding = sf::Vector2f( 0.0f, 0.0f ))

Constructs a PaddingComponent with optional initial padding.

Parameters
paddingPadding vector (x, y) (default is ( 0.0f, 0.0f )).

◆ ~PaddingComponent()

virtual wEngine::PaddingComponent::~PaddingComponent ( )
virtualdefault

Member Function Documentation

◆ setPadding()

void wEngine::PaddingComponent::setPadding ( sf::Vector2f padding)

Sets the padding vector.

Parameters
paddingNew padding values (x, y).

◆ getPadding()

sf::Vector2f wEngine::PaddingComponent::getPadding ( ) const
nodiscard

Returns the current padding values.

Returns
Padding vector (x, y).

◆ debugPrint()

void wEngine::PaddingComponent::debugPrint ( ) const

Prints the current padding values to standard output for debugging.


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