Search in sources :

Example 1 with LightContainer

use of eidolons.libgdx.screens.map.layers.LightLayer.LightContainer in project Eidolons by IDemiurge.

the class LightLayer method init.

@Override
protected void init() {
    for (LIGHT_LAYER sub : LIGHT_LAYER.values()) {
        MapMaster.addToFloatMap(timerMap, sub, 0f);
        MapMaster.addToFloatMap(triggerMap, sub, 0f);
    }
    // randomize?
    for (LIGHT_LAYER sub : LIGHT_LAYER.values()) {
        // random position?
        for (int i = 0; i < sub.maxCount; i++) {
            LightContainer container = new LightContainer(getPath() + sub.name().replace("_", " ") + ".png", sub);
            container.setAlphaTemplate(sub.alphaTemplate);
            for (DAY_TIME time : sub.times) MapMaster.addToListMap(map, time, container);
        }
    }
    initialized = true;
}
Also used : DAY_TIME(main.content.enums.macro.MACRO_CONTENT_CONSTS.DAY_TIME) LightContainer(eidolons.libgdx.screens.map.layers.LightLayer.LightContainer)

Example 2 with LightContainer

use of eidolons.libgdx.screens.map.layers.LightLayer.LightContainer in project Eidolons by IDemiurge.

the class LightLayer method spawnLayer.

@Override
protected void spawnLayer() {
    if (uiStage)
        setSize(GdxMaster.getWidth(), GdxMaster.getHeight());
    else
        setSize(MapScreen.defaultSize, MapScreen.defaultSize);
    displayed = map.get(time);
    for (LightContainer sub : displayed) {
    // triggerMap.put(sub, time);
    // if implement oneshot light, this will be easier
    }
    // Collections.shuffle(displayed);
    // add gradually?
    // remove if alpha zero?
    // displayed = displayed.subList(0, getMaxLayers());
    displayed.forEach(LightContainer -> {
        adjust(LightContainer);
    });
}
Also used : LightContainer(eidolons.libgdx.screens.map.layers.LightLayer.LightContainer)

Example 3 with LightContainer

use of eidolons.libgdx.screens.map.layers.LightLayer.LightContainer in project Eidolons by IDemiurge.

the class LightLayer method addLight.

protected void addLight(LIGHT_LAYER sub) {
    LightContainer container = new LightContainer(getPath() + sub.name().replace("_", " ") + ".png", sub);
    // container.setAlphaTemplate(sub.alphaTemplate);
    adjust(container);
    ActorMaster.addFadeInAndOutAction(container.getContent(), 2.5f, true);
}
Also used : LightContainer(eidolons.libgdx.screens.map.layers.LightLayer.LightContainer)

Aggregations

LightContainer (eidolons.libgdx.screens.map.layers.LightLayer.LightContainer)3 DAY_TIME (main.content.enums.macro.MACRO_CONTENT_CONSTS.DAY_TIME)1