Hide dialog
This commit is contained in:
parent
f33844834b
commit
b9ea226344
6
dialog.c
6
dialog.c
@ -256,6 +256,10 @@ Rectangle dialog_option_inner_rectangle(Dialog *d, int i) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void dialog_draw(Dialog *d) {
|
void dialog_draw(Dialog *d) {
|
||||||
|
Vector2 mouse_pos = GetMousePosition();
|
||||||
|
DrawText("Hide Dialog", 1225, 850, 30, BLACK);
|
||||||
|
if (mouse_pos.x > 1225 && mouse_pos.y > 850) return;
|
||||||
|
|
||||||
int text_width;
|
int text_width;
|
||||||
DrawRectangleRec(DIALOG_OUTER_RECTANGLE, BLACK);
|
DrawRectangleRec(DIALOG_OUTER_RECTANGLE, BLACK);
|
||||||
DrawRectangleRec(DIALOG_INNER_RECTANGLE, WHITE);
|
DrawRectangleRec(DIALOG_INNER_RECTANGLE, WHITE);
|
||||||
@ -276,8 +280,8 @@ void dialog_draw(Dialog *d) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void dialog_handle_input(Dialog *d) {
|
void dialog_handle_input(Dialog *d) {
|
||||||
|
Vector2 mouse_pos = GetMousePosition();
|
||||||
if (IsMouseButtonPressed(0)) {
|
if (IsMouseButtonPressed(0)) {
|
||||||
Vector2 mouse_pos = GetMousePosition();
|
|
||||||
for (int i = 0; i < d->options_count; i++) {
|
for (int i = 0; i < d->options_count; i++) {
|
||||||
DialogOption *o = &d->options[i];
|
DialogOption *o = &d->options[i];
|
||||||
Rectangle outer = dialog_option_outer_rectangle(d, i);
|
Rectangle outer = dialog_option_outer_rectangle(d, i);
|
||||||
|
Loading…
Reference in New Issue
Block a user