* Build the visual representation of this entity.
*/
@Override
protected void buildRepresentation(IEntity entity) {
final SpriteStore store = SpriteStore.get();
Sprite sprite = store.getSprite(translate(getClassResourcePath()));
/*
* Items are always 1x1 (they need to fit in entity slots). Extra
* columns are animation. Extra rows are ignored.
*/
final int width = sprite.getWidth();
if (width > IGameScreen.SIZE_UNIT_PIXELS) {
sprite = store.getAnimatedSprite(sprite, 0, 0, width
/ IGameScreen.SIZE_UNIT_PIXELS,
IGameScreen.SIZE_UNIT_PIXELS, IGameScreen.SIZE_UNIT_PIXELS,
100);
} else if (sprite.getHeight() > IGameScreen.SIZE_UNIT_PIXELS) {
sprite = store.getTile(sprite, 0, 0, IGameScreen.SIZE_UNIT_PIXELS,
IGameScreen.SIZE_UNIT_PIXELS);
logger.warn("Multi-row item image for: " + getClassResourcePath());
}