I would like to have some text but have each character have more colors. Here is an example,
please ignore the eggs for o’s, those are just part of my logo. The first image was created with Photoshop and the second with Word.
But instead of that showing, this is shown instead:
This does make sense because it is a font and the font has no color in it whatsoever but I want to know if there is a way to make the text colored and shaded differently like the ‘N’ appears in TYCOON. This would be displayed in a JLabel. Any help is appreciated!
2
Answers
It’s going to be pretty hard to convert text into a fancy logo… Instead use images.
Put your text into photoshop and export it as an image (like you did). Then use the image in place of the text.
First, you need to create an image for each character containing the (fancy) color you need (e.g. in PhotoShop or whatever other application you use to create images for your game).
Next, you need to use these images to draw the texts, instead of using regular fonts and the
JLabel
. So that requires (slightly) more work…As you do not provide any details on the Java components/libraries you use, I can only provide some pseudo-code as an example:
This (pseudo-code) example assumes you have
getImage()
drawCharcter()
getWidth()
Furthermore, you probably need some extra checks/
case
-statements to handle other special characters you might encounter.But the example should help you setup the code to tackle your problem.