16
Discussion - EVE / Re: Stencils with Fonts
« on: February 07, 2023, 11:58:40 AM »
Hi,
For the partial characters, one way may be to reverse your operation and print text only where the stencil is a certain value. For example here the text is only visible in the grey box area where the stencil is 1.
We have some explanation on using character widths for things like drawing highlighting using efficient rectangles, which are part of appnotes in development, and so we'll post some snippets from those here too.
Best Regards, BRT Community
For the partial characters, one way may be to reverse your operation and print text only where the stencil is a certain value. For example here the text is only visible in the grey box area where the stencil is 1.
Code: [Select]
CLEAR_COLOR_RGB(128,128,128)
CLEAR(1, 1, 1)
// increment stencil where the box is drawn
STENCIL_OP(INCR, INCR)
COLOR_A(128)
BEGIN(RECTS)
VERTEX2F(2144, 1728)
VERTEX2F(8000, 4800)
END()
// Stop the stencil incrementing
STENCIL_OP(KEEP, KEEP)
// Text only where the stencil is 1
COLOR_A(255)
STENCIL_FUNC(EQUAL, 1, 255)
CMD_TEXT(107, 144, 30, 0, "TESTS")
// return the function
STENCIL_FUNC(ALWAYS, 0, 255)
We have some explanation on using character widths for things like drawing highlighting using efficient rectangles, which are part of appnotes in development, and so we'll post some snippets from those here too.
Best Regards, BRT Community