1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2024-11-16 10:52:44 +00:00

Game Speed debug text (#103)

This commit is contained in:
Daedliy 2022-03-27 18:11:32 -03:00 committed by GitHub
parent 7c8f2ac60a
commit 730d1cb5d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2063,9 +2063,10 @@ impl Scene for GameScene {
} }
if state.settings.god_mode { if state.settings.god_mode {
let debug_name = "GOD";
state.font.draw_text_with_shadow( state.font.draw_text_with_shadow(
"GOD".chars(), debug_name.chars(),
state.canvas_size.0 - 32.0, state.canvas_size.0 - state.font.text_width(debug_name.chars(), &state.constants) - 10.0,
20.0, 20.0,
&state.constants, &state.constants,
&mut state.texture_set, &mut state.texture_set,
@ -2074,9 +2075,10 @@ impl Scene for GameScene {
} }
if state.settings.infinite_booster { if state.settings.infinite_booster {
let debug_name = "INF.B";
state.font.draw_text_with_shadow( state.font.draw_text_with_shadow(
"INF.B".chars(), debug_name.chars(),
state.canvas_size.0 - 32.0, state.canvas_size.0 - state.font.text_width(debug_name.chars(), &state.constants) - 10.0,
32.0, 32.0,
&state.constants, &state.constants,
&mut state.texture_set, &mut state.texture_set,
@ -2084,6 +2086,18 @@ impl Scene for GameScene {
)?; )?;
} }
if state.settings.speed != 1.0 {
let tick_spd_mod = format!("{:.1}x SPD", state.settings.speed);
state.font.draw_text_with_shadow(
tick_spd_mod.chars(),
state.canvas_size.0 - state.font.text_width(tick_spd_mod.chars(), &state.constants) - 10.0,
44.0,
&state.constants,
&mut state.texture_set,
ctx,
)?;
}
self.replay.draw(state, ctx, &self.frame)?; self.replay.draw(state, ctx, &self.frame)?;
self.pause_menu.draw(state, ctx)?; self.pause_menu.draw(state, ctx)?;