citro2d icon indicating copy to clipboard operation
citro2d copied to clipboard

multicolor text support

Open henlo-birb opened this issue 3 years ago • 8 comments

adds support for drawing multicolor text in one call to C2D_DrawText using a new flag C2D_MultiColor

a u32 array must also be passed to C2D_DrawText formatted like: {start_idx0, color0, start_idx1, color1, ...} where the start_idx is the index of the character where the corresponding color starts in the string. This is kind of similar to the coloredtext format in the text drawing calls Love2D.

a u32 with the length of that array must be passed as well.

henlo-birb avatar May 29 '22 02:05 henlo-birb

Good work, although indentation is a bit screwed up. This project uses hard tabs, not spaces.

fincs avatar Jun 27 '22 18:06 fincs

I must've messed it up with autoformatting, oops, thanks tho!

henlo-birb avatar Jun 27 '22 19:06 henlo-birb

Can you fix the formatting, please?

fincs avatar Jun 29 '22 16:06 fincs

done! (assuming the only issue was the spaces instead of tabs) sorry, i got busy w/ other stuff

henlo-birb avatar Jun 29 '22 20:06 henlo-birb

i think those should be fixed now, anything else?

henlo-birb avatar Jun 30 '22 01:06 henlo-birb

Looks fine to me now, but I think cur-> charNo > colors[0] should be cur->charNo >= colors[0]. No space between the dereference and the field name (style problem), and imagining you start the range at character index 1, having greater than instead of greater or equal would make the if only be true at index 2 or more (logic problem).

LiquidFenrir avatar Jun 30 '22 09:06 LiquidFenrir

fixed

henlo-birb avatar Jun 30 '22 17:06 henlo-birb

Hey! Any news about the pr?

Fewnity avatar Dec 09 '22 10:12 Fewnity