8#ifndef W_TITLE_ENTITY_HPP
9#define W_TITLE_ENTITY_HPP
15#pragma GCC diagnostic push
16#pragma GCC diagnostic ignored "-Wfloat-equal"
17#pragma GCC diagnostic ignored "-Wswitch-default"
18#include <SFML/Graphics.hpp>
19#pragma GCC diagnostic pop
53 TitleEntity(
const sf::Font& font,
const std::string& title,
bool hasFrame =
false );
61 TitleEntity(
const sf::Font& font,
const std::wstring& title,
bool hasFrame =
false );
103 void setFont(
const sf::Font& font );
127 [[nodiscard]] sf::Vector2f
getPadding( )
const;
182 void render( sf::RenderWindow& window );
193 template <
typename T >
194 void init(
const T& title );
Represents an entity in the ECS (Entity-Component System) architecture.
Definition wEntity.hpp:60
Entity representing a rectangular frame around content.
Definition wFrameEntity.hpp:43
void setFrameEnabled(bool enabled)
Enables or disables the visual frame.
Definition wTitleEntity.cpp:99
TitleEntity(const sf::Font &font, const std::string &title, bool hasFrame=false)
Constructs a title entity with specified font and text (UTF-8).
Definition wTitleEntity.cpp:22
void setCharacterSize(unsigned int size)
Sets the font size (character size) of the title.
Definition wTitleEntity.cpp:81
void setFrameFillColor(const sf::Color &color)
Sets the fill color of the frame.
Definition wTitleEntity.cpp:114
sf::Vector2f getPadding() const
Returns the internal padding of the frame.
Definition wTitleEntity.cpp:144
sf::FloatRect getTextSize() const
Returns the local bounding box of the title text.
Definition wTitleEntity.cpp:64
unsigned int getCharacterSize() const
Returns the current character size.
Definition wTitleEntity.cpp:59
void setOffset(sf::Vector2f offset)
Sets the offset relative to the base anchor position.
Definition wTitleEntity.cpp:75
void setFrameThickness(float thickness)
Sets the thickness of the frame's outline.
Definition wTitleEntity.cpp:119
sf::Color getFrameOutlineColor() const
Returns the current outline color of the frame.
Definition wTitleEntity.cpp:129
float getFrameThickness() const
Returns the frame's outline thickness.
Definition wTitleEntity.cpp:139
void setFont(const sf::Font &font)
Sets the font reference for the title.
Definition wTitleEntity.cpp:86
sf::Color getFrameFillColor() const
Returns the current fill color of the frame.
Definition wTitleEntity.cpp:134
void render(sf::RenderWindow &window)
Renders the title and its frame (if enabled) to the window.
Definition wTitleEntity.cpp:155
void setPadding(sf::Vector2f padding)
Sets the internal padding of the frame (horizontal and vertical).
Definition wTitleEntity.cpp:124
void setTextColor(sf::Color textColor)
Sets the text color.
Definition wTitleEntity.cpp:69
virtual ~TitleEntity()=default
Virtual destructor.
bool isFrameEnabled() const
Returns whether the title has a visible frame.
Definition wTitleEntity.cpp:104
void setFrameOutlineColor(const sf::Color &color)
Sets the frame's outline color.
Definition wTitleEntity.cpp:109
Definition wAxisEntity.cpp:17