20 lines
349 B
C++
20 lines
349 B
C++
#include "SDL3/SDL_video.h"
|
|
#include <button.h>
|
|
|
|
Button::Button(int x, int y, int w, int h) {
|
|
rect = {x, y, w, h};
|
|
hovered = false;
|
|
pressed = false;
|
|
clicked = false;
|
|
}
|
|
|
|
void Button::updateHover(int mouseX, int mouseY){
|
|
hovered = mouseX >= rect.x && mouseX <= rect.x + rect.w && mouseY >= rect.y && mouseY <= rect.y + rect.w;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|