libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
GuiImage.h
1/****************************************************************************
2 * libgui
3 * Daryl Borth 2009-2026
4 * GuiImage.h
5 ***************************************************************************/
6#pragma once
7
10enum class IMAGE {
11 TEXTURE,
12 COLOR
13};
14
17class GuiImage : public GuiElement
18{
19 public:
21 GuiImage();
30 GuiImage(uint8_t * tex, int w, int h);
36 GuiImage(int w, int h, PixelColor c);
38 ~GuiImage();
41 void setAngle(float a);
44 void setTile(int t);
46 void draw() override;
49 void setImage(GuiImageData * img);
54 void setImage(uint8_t * img, int w, int h);
59 void setTexture(uint8_t * tex, int w, int h);
63 void setStripe(int s);
64 protected:
66 void * texture;
68 float imageangle;
69 int tile;
70 int stripe;
72};
GuiElement()
Constructor.
Definition GuiElement.cpp:9
Decodes compressed image data (PNG) into a platform-native texture created from it.
int stripe
Alpha value (0-255) to apply a stripe effect to the texture.
Definition GuiImage.h:70
bool ownsTexture
Whether this object created texture itself (TEXTURE/COLOR) or borrowed it from a GuiImageData.
Definition GuiImage.h:67
void setTile(int t)
Sets the number of times to draw the image horizontally.
Definition GuiImage.cpp:142
void * texture
Attached platform-native texture.
Definition GuiImage.h:66
PixelColor baseColor
Stored color for IMAGE::COLOR types.
Definition GuiImage.h:71
void setAngle(float a)
Sets the image rotation angle for drawing.
Definition GuiImage.cpp:137
IMAGE imgType
Type of image data (TEXTURE, COLOR)
Definition GuiImage.h:65
void setTexture(uint8_t *tex, int w, int h)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition GuiImage.cpp:122
~GuiImage()
Destructor.
Definition GuiImage.cpp:67
float imageangle
Angle to draw the image.
Definition GuiImage.h:68
void setImage(GuiImageData *img)
Sets up a new image using the GuiImageData object specified.
Definition GuiImage.cpp:76
GuiImage()
Constructor.
Definition GuiImage.cpp:10
void draw() override
Constantly called to draw the image.
Definition GuiImage.cpp:152
void setStripe(int s)
Sets a stripe effect on the image, overlaying alpha blended rectangles Does not alter the image data.
Definition GuiImage.cpp:147
int tile
Number of times to draw (tile) the image horizontally.
Definition GuiImage.h:69
IMAGE
Whether a GuiImage draws a texture or a flat color.
Definition GuiImage.h:10
8-bit-per-channel RGBA color used by the video interfaces.
Definition Mesh.h:16