use of com.b3dgs.lionengine.graphic.SpriteFont in project lionengine by b3dgs.
the class SpriteFontTest method testHashCode.
/**
* Test hash code.
*/
@Test
public void testHashCode() {
final SpriteFont sprite = new SpriteFontImpl(media, font, 6, 7);
sprite.load();
final int code = sprite.hashCode();
Assert.assertNotEquals(code, new SpriteFontImpl(media, font, 6, 7).hashCode());
Assert.assertNotEquals(code, new Object().hashCode());
Assert.assertNotEquals(code, new SpriteFontImpl(media, Medias.create("fontdata2.xml"), 1, 7).hashCode());
Assert.assertNotEquals(code, new SpriteFontImpl(media, font, 1, 7).hashCode());
Assert.assertNotEquals(code, new SpriteFontImpl(media, font, 6, 1).hashCode());
Assert.assertNotEquals(code, new SpriteFontImpl(media, font, 1, 1).hashCode());
}
use of com.b3dgs.lionengine.graphic.SpriteFont in project lionengine by b3dgs.
the class SpriteFontTest method testSetFade.
/**
* Test set fade.
*/
@Test
public void testSetFade() {
final SpriteFont sprite = new SpriteFontImpl(media, font, 6, 7);
sprite.load();
sprite.setFade(128, 128);
sprite.setFade(128, 128);
Assert.assertEquals(64, sprite.getWidth());
Assert.assertEquals(32, sprite.getHeight());
}
Aggregations