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
panel.cpp
Go to the documentation of this file.
1
#include "
./asw/modules/ui/panel.h
"
2
3
#include "
./asw/modules/draw.h
"
4
5
void
asw::ui::Panel::draw
(
Context
& ctx)
6
{
7
if
(
bg_image
) {
8
asw::draw::stretch_sprite
(
bg_image
,
transform
);
9
}
else
{
10
asw::draw::rect_fill
(
transform
,
bg
);
11
}
12
13
Widget::draw
(ctx);
14
}
asw::ui::Context
Shared state for the UI system.
Definition
context.h:75
asw::ui::Panel::draw
void draw(Context &ctx) override
Draw the panel and its children.
Definition
panel.cpp:5
asw::ui::Panel::bg
asw::Color bg
The background color.
Definition
panel.h:30
asw::ui::Panel::bg_image
asw::Texture bg_image
The background image texture.
Definition
panel.h:33
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.
asw::draw::stretch_sprite
void stretch_sprite(const asw::Texture &tex, const asw::Quad< float > &position)
Draw a sprite with the option to stretch it.
Definition
draw.cpp:67
asw::draw::rect_fill
void rect_fill(const asw::Quad< float > &position, asw::Color color)
Draw a filled rectangle.
Definition
draw.cpp:220
panel.h
Panel widget for the ASW UI module.
Generated by
1.12.0