add buttons to pause menu
This commit is contained in:
parent
a4cfbb4beb
commit
48082cf098
1 changed files with 12 additions and 2 deletions
|
@ -620,10 +620,20 @@ impl Editor {
|
||||||
}
|
}
|
||||||
Popup::PauseMenu => {
|
Popup::PauseMenu => {
|
||||||
let bounds = screen_centered_rect(d, 300, 400);
|
let bounds = screen_centered_rect(d, 300, 400);
|
||||||
d.draw_rectangle_rec(bounds, BG_DARK);
|
d.draw_rectangle_rec(bounds, BG_MEDIUM);
|
||||||
let x = bounds.x as i32;
|
let x = bounds.x as i32;
|
||||||
let y = bounds.y as i32;
|
let y = bounds.y as i32;
|
||||||
d.draw_text("Menu", x + 5, y + 5, 30, Color::LIGHTBLUE);
|
d.draw_text("Menu", x + 10, y + 10, 30, Color::LIGHTBLUE);
|
||||||
|
if text_button(d, &self.mouse, x + 10, y + 40, 280, "Resume") {
|
||||||
|
self.popup = Popup::None;
|
||||||
|
}
|
||||||
|
if text_button(d, &self.mouse, x + 10, y + 80, 280, "Save") {
|
||||||
|
self.exit_state = ExitState::Save;
|
||||||
|
self.popup = Popup::None;
|
||||||
|
}
|
||||||
|
if text_button(d, &self.mouse, x + 10, y + 120, 280, "Exit to main menu") {
|
||||||
|
self.exit_state = ExitState::ExitAndSave;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Popup::None => (),
|
Popup::None => (),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue