mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2024-11-26 15:23:38 +00:00
Initial Android pause menu support
This commit is contained in:
parent
b457f5dd6f
commit
c4f1c60e35
Binary file not shown.
Before Width: | Height: | Size: 789 B After Width: | Height: | Size: 16 KiB |
|
@ -143,7 +143,7 @@ impl GameEntity<(&Player, &mut Inventory)> for HUD {
|
|||
|
||||
let wtype = self.weapon_types[a];
|
||||
if wtype != 0 {
|
||||
rect = Rect::new_size(pos_x + weapon_offset - 4, 16 - 4, 24, 24);
|
||||
rect = Rect::new_size(pos_x + weapon_offset - 4, 16 + (4 * state.scale as isize), 24, 24);
|
||||
|
||||
if state.touch_controls.consume_click_in(rect) {
|
||||
state.sound_manager.play_sfx(4);
|
||||
|
|
|
@ -124,6 +124,8 @@ impl TouchControls {
|
|||
&Rect::new_size(0, 3 * 32, 32, 32),
|
||||
);
|
||||
|
||||
batch.add_rect_tinted(4.0, 4.0, color, &Rect::new_size(32, 3 * 32, 32, 32));
|
||||
|
||||
batch.draw(ctx)?;
|
||||
}
|
||||
|
||||
|
|
|
@ -216,6 +216,10 @@ impl PlayerController for TouchPlayerController {
|
|||
))
|
||||
.is_some(),
|
||||
);
|
||||
|
||||
self.state.set_pause(
|
||||
self.state.pause() || state.touch_controls.point_in(Rect::new_size(0, 0, 20, 20)).is_some(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue