blob: a12e3a7b5ea2b54613f90c33202e64e20528bcb6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#include "UI.h"
#include <raylib.h>
void UpdateButton(Button *btn) {
if (IsMouseInRec(btn->previousFramePosition) && IsMouseButtonReleased(MOUSE_BUTTON_LEFT)) {
btn->OnClick(btn->parent);
}
}
void DrawButton(Button *btn, Rectangle *location) {
DrawTexturePro(*btn->atlas,
btn->textrueLocation,
*location,
(Vector2) { 0 , 0 },
0,
WHITE);
btn->previousFramePosition = *location;
}
|