2016-07-12 31 views
0

Ich habe Referenzen zu diesem Fehler vor, aber keine Lösung gesehen.Slick2d Kordel zieht eine Box, kein Text

Wo ich den Text zeichne, wird nur eine durchgezogene Box der angegebenen Farbe gezeichnet.

Der Code ist wie folgt:

TrueTypeFont font; 
    Font awtFont = new Font("Arial Unicode MS", Font.BOLD, 12); //name, style (PLAIN, BOLD, or ITALIC), size 
    font = new TrueTypeFont(awtFont, true); //base Font, anti-aliasing true/false 

    while (!Display.isCloseRequested()) { 
     render(); 

     font.drawString(10, 10, "ABC123", Color.black); //x, y, string to draw, color 

Antwort

0
//ENABLE THESE: 

glEnable(GL_BLEND); 
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 


//RENDER LIKE THIS: 

glPushMatrix(); 
bodyPosition = body.getPosition().mul(30); 
glTranslatef(Position.x, Position.y, 0); 
GL11.glDisable(GL11.GL_TEXTURE_2D); 
glPopMatrix();