GLY is a 1-bit graphic format for Uxn glyphs.
Gly is an inline graphics format used to draw 1-bit glyphs inside of ascii text, in which each byte is used to represent 4 vertical pixels. Glyphs are supported by Left, and can be generated in Noodle.
| ascii | x+1 | y*4 | 4 pixels | ||||
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
The format resides entirely in the second half of the ascii table, or above $80. At the end of each row, the character 0a denotes the end of line, a 32px high sprite, will have two line breaks. The Y bit shifts the pixels drawing by 4 pixels vertically for a total of 16 vertical pixels, the X bit advances the rendering by 1 pixel horizontally.
GLY Example
| 32x32 Sprite | |
|---|---|
![]() |
9faf ff88 e384 98e2 8294 e281 96a2 fe8f 97e2 97a2 fc88 95a2 f284 95a2 fc82 95e2 8195 a2fe 8195 e281 95a2 fe81 95e2 8195 a2fc 8195 a2f2 8195 a2fc 8195 e281 95a2 fe81 95e2 8195 e281 95e2 8195 aeff 8195 e581 9de8 8195 f181 93f2 8191 f189 92e8 8594 acff 8398 e281 e10a 8f9f afff f8f8 f889 97ac f8a2 f988 97ac f881 f893 aef9 8894 f881 93ac f8a2 f989 97ac f8f8 8897 acf8 81a2 f993 acf8 8894 f881 93ae f9f8 f8f8 8f9f afff f4f2 f1e8 e4e2 8f9f e1c0 c00a |
Draw a character's glyph in Uxntal when the screen's auto byte is set to auto-y:
@draw-gly ( char color -- ) STH STH .Screen/y DEI2 ( y ) #00 STHkr #30 AND #24 SFT OVR2 ++ .Screen/y DEO2 #0400 &loop STHkr #0f AND OVR SFT #01 AND ( pixel ) OVRr STHr #00 ! * .Screen/pixel DEO INC GTHk ,&loop JCN POP2 .Screen/y DEO2 ( x ) NIPr STHr #06 SFT #01 AND JMP RTN .Screen/x DEI2k INC2 ROT DEO2 RTN
