lwjgl slick util text drawing not working

34 views Asked by At

I'm having trouble drawing text with legacy LWJGL. There seems to be no problem, but there is no text displayed on the screen. How do I fix it? Code here. constructor:

public Text(Canvas canvas, int x, int y, String text) {
        super(canvas, x, y);
        this.text = text;
        Font awtFont = new Font("Arial", Font.BOLD, 24); //name, style (PLAIN, BOLD, or ITALIC), size
        font = new TrueTypeFont(awtFont, false); //base Font, anti-aliasing true/false
    }

and rendering:

GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
font.drawString(x, y, text);
GL11.glDisable(GL11.GL_BLEND);

I googled it, but things like GL_BLEND didn't work.

0

There are 0 answers