use of com.b3dgs.lionengine.graphic.Text in project lionengine by b3dgs.
the class TextAwtTest method testNormal.
/**
* Test normal.
*/
@Test
public void testNormal() {
final Text text = Graphics.createText(Constant.FONT_DIALOG, 12, TextStyle.NORMAL);
text.draw(g, 0, 0, VALUE);
text.draw(g, 0, 0, Align.CENTER, VALUE);
text.draw(g, 0, 0, Align.LEFT, VALUE);
text.draw(g, 0, 0, Align.RIGHT, VALUE);
text.setAlign(Align.CENTER);
text.setColor(ColorRgba.BLACK);
text.setLocation(1, 5);
text.setText(VALUE);
Assert.assertEquals(12, text.getSize());
Assert.assertEquals(1, text.getLocationX());
Assert.assertEquals(5, text.getLocationY());
Assert.assertTrue(text.getWidth() == 0);
Assert.assertTrue(text.getHeight() == 0);
text.render(g);
text.render(g);
Assert.assertTrue(text.getWidth() > 0);
Assert.assertTrue(text.getHeight() > 0);
}