HELP! (Slick2D)

So I´m trying to pretty up my game, but I can´t get Slick2D to render fronts using the UnicodeFont class. (So I can´t use some of the fancier functions from that class)

using the Graphics Class, I manage to:

g.Drawstring(¨foo¨,x,y);

But when I do:

UnicodeFont font = new Unicodefont(new Font(fontname, Font.Plain,20);
font.draw(x,y,¨foo);

Nothing happens.

I have tried to add a font effect to UnicodeFont, but it is still not displaying :-(

Halp, please?

EDIT: Thanks for all the help! It turns out that I have to font.loadGlyphs() at every render cycle to get my font to display.

Tags: code, help, java

Comments

18. Dec 2011 · 10:47 UTC
Got some help _> lolwut?
kibertoad
18. Dec 2011 · 10:54 UTC
Are you sure you want to use UnicodeFonts? AngelCode fonts are much faster, you can generate them from ttf (don’t forget to remember some symbols) with this utility
Jarek Radosz
18. Dec 2011 · 10:54 UTC
after adding the font effect:
kibertoad
18. Dec 2011 · 10:54 UTC
remember -> “select” some symbols, I meant – otherwise you’ll generate empty font :).
18. Dec 2011 · 11:16 UTC
Yeah, I forgot to load the glyphs :-(

So as far I as can tell, loadGlyphs() is kind of a ¨Flush¨, and the ¨Draw()¨ method doesn´t really draw? That makes sense with the behavior I´m seeing.