amethyst / amethyst/bracket-lib

Alignment of text vs hollow_box

Aberta
#259 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Rust
Estrelas
1.7k
Forks
126
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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:

![Screenshot from 2022-02-15 08-15-22](https://user-images.githubusercontent.com/193238/154021142-ba645215-1a38-48f1-afd5-3cf561e74e33.png)

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!

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.