amethyst / amethyst/rustrogueliketutorial

Wrong value in UI (Chapter 52)

Đang mở
#219 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
970
Fork
166
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

https://github.com/amethyst/rustrogueliketutorial/blob/33872fe582f226178436847e1f74eafcbf9c0d1a/book/src/chapter_52.md?plain=1#L244

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:
```
const STATUS_BOX_HEIGHT: i32 = 8; // Top-right panel
pub const CAMERA_WIDTH: i32 = 48;
pub const CAMERA_HEIGHT: i32 = 44;
pub const SCREEN_WIDTH: i32 = 80;
pub const SCREEN_HEIGHT: i32 = 60;
```

(The screen constants are already needed in `main.rs` for example, so it might help to have a single source of truth for these.)

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.