EditorSDL
This commit is contained in:
19
editor/button.cpp~
Normal file
19
editor/button.cpp~
Normal file
@@ -0,0 +1,19 @@
|
||||
#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;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user