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
include
asw
modules
ui
image.h
Go to the documentation of this file.
1
8
9
#ifndef ASW_MODULES_UI_IMAGE_H
10
#define ASW_MODULES_UI_IMAGE_H
11
12
#include "
../types.h
"
13
#include "
context.h
"
14
#include "
widget.h
"
15
16
namespace
asw::ui
{
17
20
class
Image
:
public
Widget
{
21
public
:
23
asw::Texture
texture
;
24
30
void
set_texture
(
const
asw::Texture
& tex,
bool
auto_size =
true
);
31
36
void
draw
(
Context
& ctx)
override
;
37
};
38
39
}
// namespace asw::ui
40
41
#endif
// ASW_MODULES_UI_IMAGE_H
asw::ui::Context
Shared state for the UI system.
Definition
context.h:97
asw::ui::Image
A texture stretched over the widget, e.g. a logo or icon in a layout.
Definition
image.h:20
asw::ui::Image::texture
asw::Texture texture
The texture to draw.
Definition
image.h:23
asw::ui::Image::set_texture
void set_texture(const asw::Texture &tex, bool auto_size=true)
Set the texture, optionally resizing the widget to match.
Definition
image.cpp:6
asw::ui::Image::draw
void draw(Context &ctx) override
Draw the image.
Definition
image.cpp:14
asw::ui::Widget
Base class for all UI widgets.
Definition
widget.h:43
context.h
UI context and focus management for the ASW UI module.
asw::ui
Definition
button.h:20
asw::Texture
std::shared_ptr< SDL_Texture > Texture
Alias for a shared pointer to an SDL_Texture.
Definition
types.h:76
types.h
Types used throughout the ASW library.
widget.h
Base widget class for the ASW UI module.
Generated by
1.12.0