Search in sources :

Example 1 with WidgetGroup

use of com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup in project Eidolons by IDemiurge.

the class InitiativePanel method init.

private void init() {
    queue = new QueueViewContainer[maxSize];
    queueGroup = new WidgetGroup();
    queueGroup.setBounds(0, 0, imageSize * visualSize + (offset - 1) * visualSize, imageSize);
    container = new Container<>(queueGroup);
    container.setBounds(imageSize - offset, queueOffsetY, imageSize * visualSize + (offset - 1) * visualSize, imageSize);
    container.left().bottom();
    if (ExplorationMaster.isExplorationOn()) {
        container.setY(imageSize);
        container.setVisible(false);
    }
    addActor(container);
    final TextureRegion textureRegion = getOrCreateR(StrPathBuilder.build("UI", "components", "2017", "panels", "initiativepanel", "initiativePanel plain.png"));
    panelImage = new ValueContainer(textureRegion);
    // 
    panelImage.setPosition(50, 25 + queueOffsetY);
    // image.align(Align.bottomLeft);
    // image.overrideImageSize(imageSize, imageSize);
    // image.setSize(imageSize, imageSize);
    ValueTooltip tooltip = new ValueTooltip();
    tooltip.setUserObject(Arrays.asList(new ValueContainer("Good time to die!", "")));
    panelImage.addListener(tooltip.getController());
    addActor(panelImage);
    // panelImage.setPosition(0, -textureRegion.getRegionHeight());
    setBounds(0, 0, imageSize * visualSize + (offset - 1) * visualSize, // textureRegion.getRegionHeight()
    imageSize + queueOffsetY);
    light = new SuperContainer(new Image(TextureCache.getOrCreateR(SHADE_LIGHT.LIGHT_EMITTER.getTexturePath())), true);
    clock = animatedClock ? createAnimatedClock() : new SuperContainer(new Image(TextureCache.getOrCreateR(StrPathBuilder.build("UI", "components", "2017", "panels", "initiativepanel", "clock.png"))), true) {

        @Override
        protected float getAlphaFluctuationMin() {
            return 0.6f;
        }

        @Override
        protected float getAlphaFluctuationPerDelta() {
            return super.getAlphaFluctuationPerDelta() / 3;
        }
    };
    clock.addListener(getClockListener());
    addActor(light);
    light.setPosition(-15, -14);
    addActor(clock);
    clock.setPosition(-23, -31);
    timeLabel = new Label("Time", StyleHolder.getSizedLabelStyle(FONT.NYALA, 22));
    addActor(timeLabel);
    timeLabel.setPosition(15, 100);
}
Also used : ValueTooltip(eidolons.libgdx.gui.tooltips.ValueTooltip) TextureRegion(com.badlogic.gdx.graphics.g2d.TextureRegion) SuperContainer(eidolons.libgdx.bf.generic.SuperContainer) Label(com.badlogic.gdx.scenes.scene2d.ui.Label) WidgetGroup(com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup) ValueContainer(eidolons.libgdx.gui.generic.ValueContainer) Image(com.badlogic.gdx.scenes.scene2d.ui.Image)

Aggregations

TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)1 Image (com.badlogic.gdx.scenes.scene2d.ui.Image)1 Label (com.badlogic.gdx.scenes.scene2d.ui.Label)1 WidgetGroup (com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup)1 SuperContainer (eidolons.libgdx.bf.generic.SuperContainer)1 ValueContainer (eidolons.libgdx.gui.generic.ValueContainer)1 ValueTooltip (eidolons.libgdx.gui.tooltips.ValueTooltip)1