Gornova/MarteEngine — Issue #70: Entity inconsistency
Author: Stef569
Created: 2011-11-22 19:46:58+00:00
State: open

When you set the graphics of an entity it sets the width and height based on the image dimensions(ok)
But when you add an animation then the width and height are not set.

Of course when you add 4 animations then the width and height *can* be different. In this case the user has to change the width and height when he activates an animation.

Since there is no setter for activating an animation it's not possible to change the width,height there.

Let's add a method in entity

public void showAnim(String animName) {
if(!animations.containsKey(animName) {
throw new IllegalArgumentException("no animation for " + animName);
}
currentAnim = animName;
width = currentAnim.getWidth();
height = currentAnim.getHeight();
}

or just assume that each animation has the same width,height and set the width when the first animation is added?(tbh assumptions are bad :-)