Skip to content

Clipped text respects multiple transparent colors #353

@jacobly0

Description

@jacobly0

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;
}

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions