use of com.b3dgs.lionengine.graphic.SpriteFont in project lionengine by b3dgs.
the class SpriteFontTest method testSetAlphaHigh.
/**
* Test set alpha too high.
*/
@Test(expected = LionEngineException.class)
public void testSetAlphaHigh() {
final SpriteFont sprite = new SpriteFontImpl(media, font, 6, 7);
sprite.setAlpha(256);
}
use of com.b3dgs.lionengine.graphic.SpriteFont in project lionengine by b3dgs.
the class SpriteFontTest method testSetOriginNull.
/**
* Test origin <code>null</code>.
*/
@Test(expected = LionEngineException.class)
public void testSetOriginNull() {
final SpriteFont sprite = new SpriteFontImpl(media, font, 6, 7);
sprite.setOrigin(null);
}
use of com.b3dgs.lionengine.graphic.SpriteFont in project lionengine by b3dgs.
the class SpriteFontTest method testLoadMediaAlready.
/**
* Test load with media already loaded.
*/
@Test(expected = LionEngineException.class)
public void testLoadMediaAlready() {
final SpriteFont sprite = new SpriteFontImpl(media, font, 6, 7);
sprite.load();
sprite.load();
}
use of com.b3dgs.lionengine.graphic.SpriteFont in project lionengine by b3dgs.
the class SpriteFontTest method testSetAlphaLow.
/**
* Test set alpha too low.
*/
@Test(expected = LionEngineException.class)
public void testSetAlphaLow() {
final SpriteFont sprite = new SpriteFontImpl(media, font, 6, 7);
sprite.setAlpha(-1);
}
use of com.b3dgs.lionengine.graphic.SpriteFont in project lionengine by b3dgs.
the class SpriteFontTest method testSetAlpha.
/**
* Test set alpha.
*/
@Test
public void testSetAlpha() {
final SpriteFont sprite = new SpriteFontImpl(media, font, 6, 7);
sprite.load();
for (int alpha = 0; alpha < 256; alpha++) {
sprite.setAlpha(alpha);
Assert.assertEquals(64, sprite.getWidth());
Assert.assertEquals(32, sprite.getHeight());
}
}
Aggregations