@Override
public void render () {
int viewWidth = Gdx.graphics.getWidth();
int viewHeight = Gdx.graphics.getHeight();
BitmapFont font = this.font;
if (font == null) {
glClearColor(0, 0, 0, 0);
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
return;
}
if (sampleTextRadio.isSelected()) {
glClearColor(renderingBackgroundColor.r, renderingBackgroundColor.g, renderingBackgroundColor.b,
renderingBackgroundColor.a);
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
batch.begin();
font.drawWrapped(batch, sampleTextPane.getText(), 0, viewHeight, viewWidth);
batch.end();
} else {
glClearColor(1, 1, 1, 1);
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
TextureRegion region = font.getRegion();
float y = viewHeight - region.getRegionHeight();
glColor4f(renderingBackgroundColor.r, renderingBackgroundColor.g, renderingBackgroundColor.b, 0);
glBegin(GL_QUADS);
glVertex3f(0, y + region.getRegionHeight(), 0);