Search in sources :

Example 96 with Label

use of com.badlogic.gdx.scenes.scene2d.ui.Label 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)

Example 97 with Label

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

the class RadialValueContainer method setVisible.

@Override
public void setVisible(boolean visible) {
    setUnderlay(valid ? RADIAL_UNDERLAYS.BLACK_BEVEL.getTextureRegion() : RADIAL_UNDERLAYS.BLACK_BEVEL_DISABLED.getTextureRegion());
    setUnderlayOffsetX(0);
    setUnderlayOffsetY(0);
    if (visible) {
        if (infoTextSupplier != null) {
            if (infoLabel == null) {
                infoLabel = new Label(infoTextSupplier.get(), StyleHolder.getSizedLabelStyle(FONT.RU, 18));
                addActor(infoLabel);
            } else {
                infoLabel.setText(infoTextSupplier.get());
            }
            infoLabel.setColor(valid ? new Color(1, 1, 1, 1) : new Color(1, 0.2f, 0.3f, 1));
            infoLabel.setPosition((64 - infoLabel.getWidth()) / 2, (imageContainer.getActor().getContent().getImageHeight() + infoLabel.getHeight()) / 2);
        }
        if (tooltip == null)
            if (getTooltipSupplier() != null) {
                try {
                    tooltip = tooltipSupplier.get();
                } catch (Exception e) {
                    main.system.ExceptionMaster.printStackTrace(e);
                }
                if (tooltip != null)
                    addListener(tooltip.getController());
            }
    }
}
Also used : Color(com.badlogic.gdx.graphics.Color) Label(com.badlogic.gdx.scenes.scene2d.ui.Label)

Example 98 with Label

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

the class HeroInfoPanel method initHeader.

@Override
protected void initHeader(TablePanel<Actor> header) {
    super.initHeader(header);
    emblem = new Image(getDefaultEmblem());
    // header.addNormalSize(preview).left();
    header.addElement(title).left();
    // header.addNormalSize(emblem).colspan(2). right().padRight(20);
    // header.pack();
    header.row();
    mainInfo = new Label("", StyleHolder.getSizedLabelStyle(FONT.MAGIC, 18));
    mainInfo.setText("A touch of Fate...");
    header.addNormalSize(mainInfo).padTop(50);
}
Also used : Label(com.badlogic.gdx.scenes.scene2d.ui.Label) Image(com.badlogic.gdx.scenes.scene2d.ui.Image)

Example 99 with Label

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

the class ScenarioInfoPanel method initHeader.

@Override
protected void initHeader(TablePanel<Actor> header) {
    header.addNormalSize(preview).left().padLeft(20).padTop(45);
    header.addElement(title).left();
    header.row();
    TablePanel<Actor> infoTable = new TablePanel<>();
    header.addNoGrow(infoTable);
    infoTable.padLeft(50).padTop(50);
    missionsInfo = new Label("", StyleHolder.getSizedLabelStyle(FONT.MAGIC, 18));
    missionsInfo.setText("Missions: N/A");
    infoTable.addNoGrow(missionsInfo);
    infoTable.row();
    partyInfo = new Label("", StyleHolder.getSizedLabelStyle(FONT.MAGIC, 18));
    partyInfo.setText("Party: N/A");
    infoTable.addNoGrow(partyInfo);
    infoTable.row();
    mainInfo = new Label("", StyleHolder.getSizedLabelStyle(FONT.MAGIC, 18));
    mainInfo.setText("Difficulty: Unknown");
    infoTable.addNoGrow(mainInfo);
}
Also used : Actor(com.badlogic.gdx.scenes.scene2d.Actor) Label(com.badlogic.gdx.scenes.scene2d.ui.Label) TablePanel(eidolons.libgdx.gui.panels.TablePanel)

Example 100 with Label

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

the class ValueContainer method init.

protected void init(TextureRegion texture, String name, String value) {
    imageContainer = addElement(null);
    setName(name);
    if (texture != null) {
        imageContainer.setActor(new ImageContainer(new Image(texture))).height(texture.getRegionHeight()).width(texture.getRegionWidth()).center();
    } else {
        imageContainer.fill(false).expand(0, 0);
    }
    if (isVertical()) {
        row();
    }
    this.nameContainer = addElement(null);
    if (isVertical()) {
        row();
    }
    if (name != null) {
        setName(name);
        nameLabel = new Label(name, style);
    }
    nameContainer.setActor(nameLabel).grow().center().padRight(12);
    valueContainer = addElement(null);
    if (isVertical()) {
        row();
    }
    if (StringUtils.isNotEmpty(value)) {
        valueLabel = new Label(value, style);
    }
    valueContainer.setActor(valueLabel).grow().center();
    setNameAlignment(Align.center);
    setValueAlignment(Align.center);
    initSize();
}
Also used : Label(com.badlogic.gdx.scenes.scene2d.ui.Label) Image(com.badlogic.gdx.scenes.scene2d.ui.Image) ImageContainer(eidolons.libgdx.bf.generic.ImageContainer)

Aggregations

Label (com.badlogic.gdx.scenes.scene2d.ui.Label)117 Table (com.badlogic.gdx.scenes.scene2d.ui.Table)51 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)39 Stage (com.badlogic.gdx.scenes.scene2d.Stage)39 Actor (com.badlogic.gdx.scenes.scene2d.Actor)38 TextButton (com.badlogic.gdx.scenes.scene2d.ui.TextButton)38 ChangeListener (com.badlogic.gdx.scenes.scene2d.utils.ChangeListener)33 Skin (com.badlogic.gdx.scenes.scene2d.ui.Skin)30 Image (com.badlogic.gdx.scenes.scene2d.ui.Image)28 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)21 Texture (com.badlogic.gdx.graphics.Texture)18 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)17 InputListener (com.badlogic.gdx.scenes.scene2d.InputListener)17 ScrollPane (com.badlogic.gdx.scenes.scene2d.ui.ScrollPane)17 Dialog (com.badlogic.gdx.scenes.scene2d.ui.Dialog)16 TextField (com.badlogic.gdx.scenes.scene2d.ui.TextField)16 ImageTextButton (com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton)13 ImageButton (com.badlogic.gdx.scenes.scene2d.ui.ImageButton)12 ScreenViewport (com.badlogic.gdx.utils.viewport.ScreenViewport)12 BitmapFont (com.badlogic.gdx.graphics.g2d.BitmapFont)11