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