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
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
16namespace asw::ui {
17
20class Image : public Widget {
21public:
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
Shared state for the UI system.
Definition context.h:97
A texture stretched over the widget, e.g. a logo or icon in a layout.
Definition image.h:20
asw::Texture texture
The texture to draw.
Definition image.h:23
void set_texture(const asw::Texture &tex, bool auto_size=true)
Set the texture, optionally resizing the widget to match.
Definition image.cpp:6
void draw(Context &ctx) override
Draw the image.
Definition image.cpp:14
Base class for all UI widgets.
Definition widget.h:43
UI context and focus management for the ASW UI module.
std::shared_ptr< SDL_Texture > Texture
Alias for a shared pointer to an SDL_Texture.
Definition types.h:76
Types used throughout the ASW library.
Base widget class for the ASW UI module.