KolibriLib
Loading...
Searching...
No Matches
KolibriLib::UI::text::TextLabel Class Reference

Текстовая метка More...

#include <text.hpp>

Inheritance diagram for KolibriLib::UI::text::TextLabel:
KolibriLib::UI::UIElement

Public Member Functions

 TextLabel (const Coord &coord={0, 0}, const Size &size={16, 16}, const std::string &text="Text", const unsigned &FontSize=9, bool TextScale=true, const Color::Color &TextColor=OS::sys_color_table.work_text, const unsigned &Margin=0)
 Конструктор
 
void Render ()
 Отрисовать текстовую метку
 
std::string GetText ()
 Получить текст
 
unsigned GetFontSize ()
 Получить Размер шрифта
 
Color::Color GetTextColor ()
 Получить цвет текста
 
void SetText (const std::string &NewText)
 Изменить текст
 
void SetFontSize (const unsigned &NewTextSize)
 Изменить рамер текста
 
void SetScale (bool scale)
 Изменить значение переменной _TextScale.
 
void init (Coord coord, Size size, std::string text, unsigned FontSize, Color::Color TextColor)
 
- Public Member Functions inherited from KolibriLib::UI::UIElement
 UIElement (const Coord &coord={0, 0}, const Size &size={16, 16}, const Color::Color &MainColor=0, const unsigned &Margin=DefaultMargin)
 
Size GetSize ()
 
void SetSize (Size NewSize)
 
unsigned GetMargin ()
 
Color::Color GetColor ()
 Получить осносной цвет элемента
 
void SetColor (Color::Color NewColor)
 
void SetCoord (Coord NewCoord)
 
Coord GetCoord ()
 
UIElementoperator= (const UIElement &Element)
 

Additional Inherited Members

- Protected Attributes inherited from KolibriLib::UI::UIElement
Coord _coord
 Координаты
 
Size _size
 Размер
 
Color::Color _MainColor
 
unsigned _Margin
 Отступы
 

Detailed Description

Текстовая метка

Constructor & Destructor Documentation

◆ TextLabel()

KolibriLib::UI::text::TextLabel::TextLabel ( const Coord & coord = {0, 0},
const Size & size = {16, 16},
const std::string & text = "Text",
const unsigned & FontSize = 9,
bool TextScale = true,
const Color::Color & TextColor = OS::sys_color_table.work_text,
const unsigned & Margin = 0 )

Конструктор

Parameters
coordкоордината
sizeРамер элемента, игнорируется если TextScale = false
textТекст текста
FontSizeРазмер текста
TextScaleМаштабировать текст, чтобы он не выходил за границы элемента
MarginОтступы от границ

Member Function Documentation

◆ GetFontSize()

unsigned KolibriLib::UI::text::TextLabel::GetFontSize ( )

Получить Размер шрифта

Returns
_FontSize

◆ GetText()

std::string KolibriLib::UI::text::TextLabel::GetText ( )

Получить текст

Returns
_text

◆ GetTextColor()

Color::Color KolibriLib::UI::text::TextLabel::GetTextColor ( )

Получить цвет текста

Returns
_TextColor

◆ SetFontSize()

void KolibriLib::UI::text::TextLabel::SetFontSize ( const unsigned & NewTextSize)

Изменить рамер текста

Parameters
NewTextSizeНовый размер текста (в px)

◆ SetScale()

void KolibriLib::UI::text::TextLabel::SetScale ( bool scale)

Изменить значение переменной _TextScale.

Parameters
scaleНовое значение

◆ SetText()

void KolibriLib::UI::text::TextLabel::SetText ( const std::string & NewText)

Изменить текст

Parameters
NewTextТекст

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