Friday | 19 APR 2024
[ previous ]
[ next ]

Uxn - Fonts 1

Title:
Date: 2023-01-10
Tags:  

Working on the fonts so that I can write things to the screen in uxn.

https://nivethan.dev/toys/uxn-tools/sprite-editor.html

My sprite editor is working well and it is useful. So far all the learning tools I have written have done their job in helping my grok uxn. The next big thing is going to be to learn how memory and the runes work.

The font is also coming along now:

This seems a bit messy and doesn't feel quite right. Once I actually get this stuff working, I'll take a look at what left does to see if it structured the same way. It could be that the idea is fine, I need the font sprites but my drawing skills might just be bad. It could also be that there is special logic you need to get fonts to look nice with the spacing.

( devices )
|00 @System  [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
|20 @Screen  [ &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 ]

( macros )
%DRAW-LETTER {
    .Screen/addr DEO2
    .Screen/x DEI2 
    #0008 ADD2
    .Screen/x DEO2 
    #42 .Screen/sprite DEO
}

( main )
|0100
    #5ce9 .System/r DEO2
    #01c0 .System/g DEO2
    #2135 .System/b DEO2

    #0008 #0008 .Screen/x DEO2 .Screen/y DEO2

    ;letter/A DRAW-LETTER
    ;letter/B DRAW-LETTER
    ;letter/C DRAW-LETTER
    ;letter/D DRAW-LETTER
    ;letter/E DRAW-LETTER
BRK

@letter
    &A 1824 4242 7e42 4242
    &B 7c42 427c 4242 427c
    &C 3c42 4040 4040 423c
    &D 7844 4242 4242 4478
    &E 7e40 407e 4040 407e