summaryrefslogtreecommitdiff
path: root/src/ui_elements/Button.c
blob: f3ab8fa3db9679de9c3badafb16afb682ac68405 (plain)
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);
}