toolchain
toolchain copied to clipboard
Clipped text respects multiple transparent colors
trafficstars
Calling gfx_SetTextConfig(gfx_text_clip); causes print routines to draw both gfx_SetTransparentColor and gfx_SetTextTransparentColor colors as transparent. For example:
#include <tice.h>
#include <graphx.h>
int main(void)
{
bool clip = false;
/* Initialize graphics drawing */
gfx_Begin();
gfx_FillScreen(0x07);
gfx_SetTransparentColor(0x18);
gfx_SetTextTransparentColor(0xE0);
gfx_SetTextBGColor(0x18);
gfx_SetTextFGColor(0xE0);
for (const char *c = "Hello, world!"; *c != '\0'; ++c, clip = !clip)
{
gfx_SetTextConfig(clip ? gfx_text_clip : gfx_text_noclip);
gfx_PrintChar(*c);
}
/* Waits for a key */
while (!os_GetCSC());
/* End graphics drawing */
gfx_End();
return 0;
}
Clipped text is just implemented horribly so :)