Search in sources :

Example 1 with StaticShadowType

use of de.gurkenlabs.litiengine.graphics.StaticShadowType in project litiengine by gurkenlabs.

the class StaticShadowMapObjectLoader method load.

@Override
public Collection<IEntity> load(IEnvironment environment, IMapObject mapObject) {
    if (MapObjectType.get(mapObject.getType()) != MapObjectType.STATICSHADOW) {
        throw new IllegalArgumentException("Cannot load a mapobject of the type " + mapObject.getType() + " with a loader of the type " + MapAreaMapObjectLoader.class);
    }
    Collection<IEntity> entities = super.load(environment, mapObject);
    StaticShadowType type = mapObject.getCustomPropertyEnum(MapObjectProperty.SHADOW_TYPE, StaticShadowType.class, StaticShadowType.DOWN);
    int offset = mapObject.getCustomPropertyInt(MapObjectProperty.SHADOW_OFFSET, StaticShadow.DEFAULT_OFFSET);
    StaticShadow shadow = this.createStaticShadow(mapObject, type, offset);
    loadDefaultProperties(shadow, mapObject);
    shadow.setOffset(offset);
    entities.add(shadow);
    return entities;
}
Also used : StaticShadowType(de.gurkenlabs.litiengine.graphics.StaticShadowType) StaticShadow(de.gurkenlabs.litiengine.graphics.StaticShadow) IEntity(de.gurkenlabs.litiengine.entities.IEntity)

Aggregations

IEntity (de.gurkenlabs.litiengine.entities.IEntity)1 StaticShadow (de.gurkenlabs.litiengine.graphics.StaticShadow)1 StaticShadowType (de.gurkenlabs.litiengine.graphics.StaticShadowType)1