joulupunikki / Phoenix

Java clone/remake/patch of the game Emperor of the Fading Suns
https://joulupunikki.github.io/Phoenix/
37 stars 14 forks source link

Text with gradient in Java #40

Open joulupunikki opened 9 years ago

joulupunikki commented 9 years ago

Original EFS texts had a three color gradient with brighter top and darker bottom, they werenot simple black-on-white (or yellow-on-black in this case.) With the combination of the rough metal backgrounds of the windows they created a very special aesthetic appearance. Currently, Phoenix texts are yellow-on-black and although passable, a gradient text would better capture the unique visual appearance of original EFS.

With java GradientPaint custom tuned to the used font, it is possible to draw gradient text with Graphics2D drawString-method. It seems that all Graphics drawString-methods can be replaced with a Phoenix UtilG.drawStringGrad-method which draws String a gradient.

Open questions:

Can this be done also for JButtons, JLabels and JTextFields, they seem to have Color objects instead of Paint objects for their foregrounds. Maybe, if all else fails, ImageIcons could be used for the buttons ?

How much processing power does all this require ?

joulupunikki commented 9 years ago

GradienPaint fonts are now used in main menu titles, resource panel, and unitinfowindow lower left corner faction names. It does look better than plain yellow, but is not quite like in EFS1.4. The fonts may need tuning as well.

joulupunikki commented 7 years ago

TexturePaint is promising. Ignoring potential performance issues, 1:1 coloration with original EFS fonts seems within reach.