-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multicolor text support #42
base: master
Are you sure you want to change the base?
Conversation
Good work, although indentation is a bit screwed up. This project uses hard tabs, not spaces. |
I must've messed it up with autoformatting, oops, thanks tho! |
Can you fix the formatting, please? |
done! (assuming the only issue was the spaces instead of tabs) sorry, i got busy w/ other stuff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a bug when a character is in the last range of colours and the next character also is.
You also don't properly reset to the default opaque black (or WithColor-provided value) when the first range doesn't start at the beginning of the text, instead drawing with the last drawn character's colour.
i think those should be fixed now, anything else? |
Looks fine to me now, but I think |
fixed |
Hey! Any news about the pr? |
adds support for drawing multicolor text in one call to
C2D_DrawText
using a new flagC2D_MultiColor
a
u32
array must also be passed toC2D_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.