agbrs / agb

Library for writing Game Boy Advance games in Rust
https://agbrs.dev/
Mozilla Public License 2.0
320 stars 27 forks source link

Tile mode 0 and 8x8px tiles #793

Closed phughk closed 1 month ago

phughk commented 1 month ago

I am trying to enable background tiles using 8x8 pixel tiles from a map.

I may be misunderstanding something here, but from this page I can see that 8x8 tiles are supported. I don't think that means 8 tiles by 8 tiles, since that would not match the screen resolution (unless it includes the off-screen buffers).

From RegularBackgroundSize it doesn't seem like 8x8 is supported.

I am really trying to get 8x8 tiles across the screen. This is 600 tiles in total (30x20) which I cannot do with Sprites. And the font loader is tied to ttf - if you know how I can turn a 8x8 tile map png into a ttf then I would be over the moon as well.

Thanks!

corwinkuiper commented 1 month ago

All tiles are 8 pixels by 8 pixels. The smallest background is 32 tiles by 32 tiles, this is larger than the screen.

phughk commented 1 month ago

So I have rummaged around and discovered that the fonts are actually dynamic tiles that are generated on the fly.

Given that I would like to have the option to set the fg/bg colours of individual tiles, would it be possible to have a png to font loader that is not dependent on ttf loading? Happy for it to have 0 kerning for all values. And the range would be 256.

We can change the issue, and I am happy to work on it if it's agreed that it would be useful.

corwinkuiper commented 1 month ago

We use https://yal.cc/r/20/pixelfont/ for this