toolchain icon indicating copy to clipboard operation
toolchain copied to clipboard

Clipped text respects multiple transparent colors

Open jacobly0 opened this issue 3 years ago • 1 comments
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;
}

jacobly0 avatar Jan 23 '22 09:01 jacobly0

Clipped text is just implemented horribly so :)

mateoconlechuga avatar Jan 23 '22 23:01 mateoconlechuga