/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package engine.display;

import java.awt.Font;
import org.lwjgl.opengl.GL11;
import org.newdawn.slick.Color;
import org.newdawn.slick.TrueTypeFont;

/**
 *
 * @author Michael Miriti <michael@miriti.ru>
 */
public class TextField extends DisplayObject {

    private Font font;
    private String text;
    private Color sColor;
    private TrueTypeFont ttf;

    public TextField(Font font, String text, Color sColor) {
        super();
        this.font = font;
        this.sColor = sColor;
        ttf = new TrueTypeFont(font, true);
        setText(text);
    }

    @Override
    protected void selfRender() {
        GL11.glDisable(GL11.GL_TEXTURE_2D);
        ttf.drawString(512, 256, text);
        GL11.glEnable(GL11.GL_TEXTURE_2D);
    }

    public String getText() {
        return text;
    }

    public final void setText(String text) {
        this.text = text;
    }
}
