use of com.b3dgs.lionengine.graphic.SpriteFont in project lionengine by b3dgs.
the class SpriteFontTest method testLoadMedia.
/**
* Test load with media.
*/
@Test
public void testLoadMedia() {
final SpriteFont sprite = new SpriteFontImpl(media, font, 6, 7);
sprite.load();
Assert.assertNotNull(sprite.getSurface());
sprite.prepare();
sprite.dispose();
}
use of com.b3dgs.lionengine.graphic.SpriteFont in project lionengine by b3dgs.
the class SpriteFontTest method testConstructorMedia.
/**
* Test constructor with media.
*/
@Test
public void testConstructorMedia() {
final SpriteFont sprite = new SpriteFontImpl(media, font, 6, 7);
Assert.assertFalse(sprite.isLoaded());
Assert.assertNull(sprite.getSurface());
Assert.assertEquals(64, sprite.getWidth());
Assert.assertEquals(32, sprite.getHeight());
}
use of com.b3dgs.lionengine.graphic.SpriteFont in project lionengine by b3dgs.
the class SpriteFontTest method testFilterBilinear.
/**
* Test filter bilinear.
*/
@Test
public void testFilterBilinear() {
final SpriteFont sprite = new SpriteFontImpl(media, font, 6, 7);
sprite.load();
sprite.filter(new FilterBilinear());
Assert.assertEquals(64, sprite.getWidth());
Assert.assertEquals(32, sprite.getHeight());
}
use of com.b3dgs.lionengine.graphic.SpriteFont in project lionengine by b3dgs.
the class SpriteFontTest method testRotate.
/**
* Test rotate sprite.
*/
@Test
public void testRotate() {
final SpriteFont sprite = new SpriteFontImpl(media, font, 6, 7);
sprite.load();
for (int angle = -720; angle < 720; angle++) {
sprite.rotate(angle);
Assert.assertTrue(angle + Constant.SPACE + sprite.getWidth(), sprite.getWidth() >= 64);
Assert.assertTrue(angle + Constant.SPACE + sprite.getHeight(), sprite.getHeight() >= 32);
}
}
use of com.b3dgs.lionengine.graphic.SpriteFont in project lionengine by b3dgs.
the class SpriteFontTest method testFilterNull.
/**
* Test filter <code>null</code>.
*/
@Test(expected = LionEngineException.class)
public void testFilterNull() {
final SpriteFont sprite = new SpriteFontImpl(media, font, 6, 7);
sprite.filter(null);
}
Aggregations