You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So we fetch the map from the ECS `World`, calculate the name's length (plus two for the wrapping characters). Then we figure out the centered position (over the map pane; so 22, half the pane width, *minus* half the length of the name). Then we draw the endcaps and the name. You can `cargo run` to see the improvement:
From what I understand, the half width is 24, and not 22 (that would be the half height of the pane).
The title doesn't seem to be centered on the matching screen.
What about extracting size constants to make the UI code easier to read? Something like this:
rustrogueliketutorial/book/src/chapter_52.md
Line 244 in 33872fe
From what I understand, the half width is 24, and not 22 (that would be the half height of the pane).
The title doesn't seem to be centered on the matching screen.
What about extracting size constants to make the UI code easier to read? Something like this:
(The screen constants are already needed in
main.rs
for example, so it might help to have a single source of truth for these.)The text was updated successfully, but these errors were encountered: