Skip to content

Colors per glyph with DrawString #31

@charles-esterbrook

Description

@charles-esterbrook

In addition to a call like this:

spriteBatch.DrawString(font, "The quick brown fox", positionVector, Color.White);

I would like to provide the colors for each glyph:

spriteBatch.DrawString(font, "The quick brown fox", positionVector, colors);

Where colors is an array of Color the same length or longer than the number of glyphs that will be rendered.

This would allow highlighting words in text, without needing bold, italics, etc. Messages like "Press [Space] to continue" could have the "[Space]" portion highlighted (presumably in the game's color scheme).

Is there a way to do something like this now?

If not, would this be possible as a feature request?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions