I saw you're planning to discuss all the remaining devices next day, exciting! If you're taking requests, I'd love to see fonts in a future day. How they work and ofc how to use them, where to find sample files (uxn repo I think?), etc. Also linking to how fonts can be made. (Nasu? Also the unreleased #Slight from @firstname.lastname@example.org)
@makeworld @sejo @zce Have you had a look at this example yet? https://git.sr.ht/~rabbits/uxn/tree/main/item/projects/examples/gui/label.tal
@neauoire I hadn't thanks! I should look more into the examples, just trying to ease in with the tutorials right now.
@makeworld i'm glad you are enjoying it!
yeah, i wanted to discuss fonts e.g. for displaying the score, but it was too much already 😅 - i might add that as an appendix of some sorts
in any case, the monospaced approach for latin characters (?) would work similarly to the sprites frames animation in day 4. you'd have a tile for each glyph, all of them under a label, in order. you choose one by adding a corresponding offset to the adddress of the label.
@makeworld i like how the screen.tal example by @neauoire illustrates that: https://git.sr.ht/~rabbits/uxn/tree/main/item/projects/examples/devices/screen.tal#L57
a nibble (resulting from #0f AND) is converted into a short ( #00 SWP ) and multiplied by 8 ( #30 SFT2 ) to get a corresponding offset, as each tile is 8 bytes long.
that offset is added to the address of the font-hex label ( ;font-hex ADD2 ) that has a tile for each hexadecimal character.
the calculated address is then sent to .Screen/addr
So, the character sprite "A"(#41) begins at (#0041 #0008 MUL2 SPRITESHEET ADD2)
If the characters were 8x16 instead of 8x8, then it would be #0041 #0010 MUL2 SPRITESHEET ADD2
I hope this helps :)
Sunbeam City is a anticapitalist, antifascist solarpunk instance that is run collectively.