libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
GuiShape.h
1/****************************************************************************
2 * libgui
3 * Daryl Borth 2026
4 * GuiShape.h
5 ***************************************************************************/
6#pragma once
7
15class GuiShape : public GuiElement
16{
17 public:
21 GuiShape(int w = 0, int h = 0);
23 ~GuiShape();
24 GuiShape(const GuiShape&) = delete;
25 GuiShape& operator=(const GuiShape&) = delete;
27 void setShape(SHAPE s);
29 void setCorners(const GuiCorners& c);
31 void setCapsule();
33 void setStyle(const GuiShapeStyle& s);
35 void setPaint(const GuiPaint& p);
37 void setTransition(float seconds);
39 void draw() override;
40 private:
41 SHAPE kind;
42 GuiCorners corners;
43 GuiShapeStyle style;
44 float transition;
45 GuiPaint from;
46 GuiPaint to;
47 GuiPaint shown;
48 float blend;
49 int blendStep;
50 bool started;
51 bool dirty;
52 int meshWidth;
53 int meshHeight;
54 float meshFeather;
55 GuiSharedMesh * mesh;
56 std::vector<MeshVertex> scratch;
57};
GuiElement()
Constructor.
Definition GuiElement.cpp:9
void setCorners(const GuiCorners &c)
Sets the corner radii of a rectangle.
Definition GuiShape.cpp:34
void setShape(SHAPE s)
Sets the shape kind (rectangle or ellipse)
Definition GuiShape.cpp:28
void setStyle(const GuiShapeStyle &s)
Sets the look for every state; applies immediately.
Definition GuiShape.cpp:45
void setPaint(const GuiPaint &p)
Sets one look for every state.
Definition GuiShape.cpp:51
void setTransition(float seconds)
Sets how long a change of state takes to blend, in seconds (0 = instant)
Definition GuiShape.cpp:56
GuiShape(int w=0, int h=0)
Constructor.
Definition GuiShape.cpp:13
void draw() override
Constantly called to draw the shape.
Definition GuiShape.cpp:73
void setCapsule()
Rounds a rectangle's ends fully (radius half the shorter side)
Definition GuiShape.cpp:40
~GuiShape()
Destructor.
Definition GuiShape.cpp:22
One cached mesh.
SHAPE
Basic shape kinds a paint can be applied to.
Definition GuiPaint.h:17
Per-corner radii, in the order top-left, top-right, bottom-right, bottom-left.
Definition GuiGeometry.h:40
A set of paints, one per state. States left unset fall back to the normal paint. GuiShapeStyle(rest)....
Definition GuiPaint.h:80