ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
Loading...
Searching...
No Matches
src
modules
ui
label.cpp
Go to the documentation of this file.
1
#include "
./asw/modules/ui/label.h
"
2
3
#include "
./asw/modules/draw.h
"
4
5
void
asw::ui::Label::draw
(
Context
& ctx)
6
{
7
if
(!
text
.empty() &&
font
!=
nullptr
) {
8
asw::draw::text
(
font
,
text
,
transform
.
position
,
color
,
justify
);
9
}
10
11
Widget::draw
(ctx);
12
}
asw::Quad::position
Vec2< T > position
The position of the rectangle.
Definition
geometry.h:552
asw::ui::Context
Shared state for the UI system.
Definition
context.h:75
asw::ui::Label::color
asw::Color color
The text color.
Definition
label.h:47
asw::ui::Label::draw
void draw(Context &ctx) override
Draw the label.
Definition
label.cpp:5
asw::ui::Label::font
asw::Font font
The font to use for rendering.
Definition
label.h:38
asw::ui::Label::text
std::string text
The text to display.
Definition
label.h:41
asw::ui::Label::justify
asw::TextJustify justify
The text justification.
Definition
label.h:44
asw::ui::Widget::transform
asw::Quad< float > transform
The transform (position and size) of the widget.
Definition
widget.h:119
asw::ui::Widget::draw
virtual void draw(Context &ctx)
Draw this widget and its children.
Definition
widget.cpp:26
draw.h
Routines for drawing sprites and primitives to the screen.
label.h
Label widget for the ASW UI module.
asw::draw::text
void text(const asw::Font &font, const std::string &text, const asw::Vec2< float > &position, asw::Color color, asw::TextJustify justify=asw::TextJustify::Left)
Draw text.
Definition
draw.cpp:151
Generated by
1.12.0