use of com.b3dgs.lionengine.graphic.SpriteFont in project lionengine by b3dgs.
the class SpriteFontTest method testDraw.
/**
* Test draw.
*/
@Test
public void testDraw() {
final Graphic g = Graphics.createImageBuffer(100, 100).createGraphic();
try {
final SpriteFont sprite = new SpriteFontImpl(media, font, 6, 7);
sprite.load();
sprite.draw(g, 1, 2, Align.CENTER, "az%");
} finally {
g.dispose();
}
}
use of com.b3dgs.lionengine.graphic.SpriteFont in project lionengine by b3dgs.
the class SpriteFontTest method testMirrorNull.
/**
* Test mirror <code>null</code>.
*/
@Test(expected = LionEngineException.class)
public void testMirrorNull() {
final SpriteFont sprite = new SpriteFontImpl(media, font, 6, 7);
sprite.setMirror(null);
}
use of com.b3dgs.lionengine.graphic.SpriteFont in project lionengine by b3dgs.
the class SpriteFontTest method testMirror.
/**
* Test mirror.
*/
@Test
public void testMirror() {
final SpriteFont sprite = new SpriteFontImpl(media, font, 6, 7);
Assert.assertEquals(Mirror.NONE, sprite.getMirror());
sprite.setMirror(Mirror.HORIZONTAL);
Assert.assertEquals(Mirror.HORIZONTAL, sprite.getMirror());
}
use of com.b3dgs.lionengine.graphic.SpriteFont in project lionengine by b3dgs.
the class SpriteFontTest method testEquals.
/**
* Test equals.
*/
@Test
public void testEquals() {
final SpriteFont sprite = new SpriteFontImpl(media, font, 6, 7);
sprite.load();
Assert.assertEquals(sprite, sprite);
Assert.assertNotEquals(sprite, new SpriteFontImpl(media, font, 6, 7));
Assert.assertNotEquals(sprite, null);
Assert.assertNotEquals(sprite, new Object());
Assert.assertNotEquals(sprite, new SpriteFontImpl(media, font, 1, 7));
Assert.assertNotEquals(sprite, new SpriteFontImpl(media, font, 6, 1));
Assert.assertNotEquals(sprite, new SpriteFontImpl(media, font, 1, 1));
}
use of com.b3dgs.lionengine.graphic.SpriteFont in project lionengine by b3dgs.
the class SpriteFontTest method testSetTransparency.
/**
* Test set transparency.
*/
@Test
public void testSetTransparency() {
final SpriteFont sprite = new SpriteFontImpl(media, font, 6, 7);
sprite.load();
sprite.setTransparency(ColorRgba.BLACK);
Assert.assertEquals(64, sprite.getWidth());
Assert.assertEquals(32, sprite.getHeight());
}
Aggregations