Example usage for com.badlogic.gdx.scenes.scene2d.ui Container height

List of usage examples for com.badlogic.gdx.scenes.scene2d.ui Container height

Introduction

In this page you can find the example usage for com.badlogic.gdx.scenes.scene2d.ui Container height.

Prototype

public Container<T> height(float height) 

Source Link

Document

Sets the minHeight, prefHeight, and maxHeight to the specified value.

Usage

From source file:de.bitbrain.craft.ui.widgets.TabWidget.java

License:Open Source License

/**
 * Registers a new tab with the given icon and the target actor
 * /*from w w  w.j  a v a  2  s .c  o  m*/
 * @param id
 *          tab id
 * @param icon
 *          tab icon to show
 * @param actor
 *          Content actor
 */
public void addTab(String id, String iconId, Actor content) {
    if (!id.isEmpty() && !tabs.containsKey(id)) {
        final Tab tab = new Tab(id, content, generateTabStyle(iconId, false), generateTabStyle(iconId, true));
        tabs.put(id, tab);
        tabGroup.addActor(tab);
        Container<?> padding = new Container<Actor>();
        padding.height(15f);
        tabGroup.addActor(padding);
        setTab(id);
        tab.addListener(new ClickListener() {
            @Override
            public void clicked(InputEvent event, float x, float y) {
                super.clicked(event, x, y);
                if (activeTabId != tab.getId()) {
                    SoundUtils.play(Assets.SND_TAB, 0.7f, 0.9f);
                }
                setTab(tab.getId());
            }
        });
    }
}