46 constexpr unsigned int disabledColor = 0xFF606060;
48 static_cast<int>(
_height), disabledColor);
62 static_cast<int>(
_height), currentColor);
67 static_cast<int>(
_height), borderColor);
72 static_cast<int>(
_width) - 2,
static_cast<int>(
_height) - 2, borderColor);
80 const int textX =
static_cast<int>(
_x + ((
_width -
static_cast<float>(textWidth)) / 2.0f));
81 const int textY =
static_cast<int>(
_y + ((
_height -
static_cast<float>(textHeight)) / 2.0f));
162 return mouseX >=
_x && mouseX <= _x + _width && mouseY >=
_y && mouseY <=
_y +
_height;
Abstract interface for graphics rendering operations.
virtual bool IsMouseButtonDown(int button) const =0
Check if a mouse button is currently being held down.
virtual int GetWindowHeight() const =0
Get current window height in pixels.
virtual void DrawRectFilled(int x, int y, int width, int height, unsigned int color)=0
Draw a filled rectangle.
virtual void DrawText(int fontHandle, const char *text, int x, int y, int fontSize, unsigned int color)=0
Draw text using a loaded font.
virtual void GetMousePosition(float &x, float &y) const =0
Get the current mouse cursor position.
virtual int GetWindowWidth() const =0
Get current window width in pixels.
virtual void DrawRect(int x, int y, int width, int height, unsigned int color)=0
Draw a rectangle outline.
virtual int GetFontHeight(int fontHandle, int fontSize)=0
Get the height of a font at a given size.
int EstimateTextWidth(const std::string &text, int fontSize)
Estimate the width of text in pixels.
ButtonState
Button state enumeration.
@ PRESSED
Mouse button is held down on the button.
@ HOVERED
Mouse is over the button.
Align
Alignment modes relative to the current window.
@ CENTER_VERTICAL
Center on the Y axis.
@ CENTER_BOTH
Center on both axes.
@ CENTER_HORIZONTAL
Center on the X axis.