Example usage for com.badlogic.gdx.scenes.scene2d.ui HorizontalGroup padLeft

List of usage examples for com.badlogic.gdx.scenes.scene2d.ui HorizontalGroup padLeft

Introduction

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

Prototype

public HorizontalGroup padLeft(float padLeft) 

Source Link

Usage

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

License:Open Source License

private Actor generateTop(Item item) {
    HorizontalGroup group = new HorizontalGroup();
    group.align(Align.left);// www.ja  v a  2s.  com
    IconWidget icon = new IconWidget(item, 0);
    icon.setHandle(icon.new DefaultIconHandle() {
        @Override
        public boolean isDraggable(int amount) {
            return false;
        }

        @Override
        public boolean isVisible(int currentAmount) {
            return false;
        }
    });
    group.addActor(icon);
    HorizontalGroup wrapper = new HorizontalGroup();
    Label caption = new Label(Bundles.items.get(item.getId().toString()), Styles.LBL_ITEM);
    caption.setColor(item.getRarity().getColor());
    icon.setWidth(caption.getHeight() * 4);
    icon.setHeight(caption.getHeight() * 4);
    wrapper.addActor(caption);
    wrapper.padLeft(15f);
    group.addActor(wrapper);
    return group;
}