Follow

@sejo thanks a lot for day 6 of the tutorial! Read/skimmed through it today, but planning on diving in and adding on to the Pong game tomorrow :)

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 from @zce@tilde.zone)

@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: git.sr.ht/~rabbits/uxn/tree/ma

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

@sejo @makeworld I tend to organize my pixel fonts following this table: wiki.xxiivv.com/site/ascii.htm

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 :)

Sign in to participate in the conversation
Sunbeam City 🌻

Sunbeam City is a anticapitalist, antifascist solarpunk instance that is run collectively.