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;
}
Aggregations