amethyst / amethyst/bracket-lib
Alignment of text vs hollow_box
- Vorherrschende Sprache
- Rust
- Sterne
- 1.7k
- Forks
- 126
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Hello,
Firstly: thank you so much for this library and for your book! I'm having a really fun time learning Rust whilst hacking on a little game idea :)
I've noticed that when drawing text compared to drawing a hollow box using `ctx.draw_hollow_box`, the two do not align up and seem to use different grids - or one is offset on the grid.
In the screenshot below, I've drawn a "T" at (x, y) using `ctx.print(x, y, "T")`. I've then got code that draws a hollow box around the mouse's position:
```
self.map.render(ctx);
let mouse_pos = INPUT.lock().mouse_tile(0);
ctx.set_active_console(2); // separate tile for mouse highlights
ctx.draw_hollow_box(mouse_pos.x, mouse_pos.y, 1, 1, YELLOW, BLACK);
```
I would (perhaps naively) expect here that I could hover over a "T" that's been drawn, and see a yellow box drawn around it, but instead it seems like the boxes are at a different offset:

I think this is probably due to how the cursor is translated into an (x, y) on the grid, but I'm not sure how to resolve or if this is even possible - am I thinking about this in the wrong way?
Thanks again!
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.