Problems in lemur button height and width

i want some thing like this but in lemur

but when I try to do that I have problems in height of button…

please help me to do that.

and this is my code :

Container left = new Container();
    float wi = AspectRatio.percentOfwinWidth(p4_w_int, settings);
    float hi = AspectRatio.percentOfwinHeight(p4_h_int, settings);
    float positionTop = settings.getHeight() - AspectRatio.percentOfwinHeight(Float.parseFloat(p4_mTop), settings);

    left.setPreferredSize(new Vector3f(wi, hi, 0));
    left.setLocalTranslation(0, positionTop, 0);
    app.getGuiNode().attachChild(left);

    // button one [show|hide minimap ]
    Button minimap_btn = left.addChild(new Button(""));

    minimap_btn.addClickCommands(new Command<Button>() {
        @Override
        public void execute(Button source) {
            hideMiniMap();
        }
    });

    minimap_btn.setIcon(new IconComponent("Interface/hud/map.png", 0.2f, 0, 0, 0, false));

    // button two
    Button pin_btn = left.addChild(new Button(""));

    pin_btn.addClickCommands(new Command<Button>() {
        @Override
        public void execute(Button source) {
            toggleMapPoint_right_panel();
        }
    });

    pin_btn.setIcon(new IconComponent("Interface/hud/location.png"));

Well, for one thing… one icon you’ve said should be scaled to 0.2.

And the other one you aren’t scaling at all:

…so it’s bound to be pretty big then.

I think you want to remove like 70% of that code and just give the container a spring grid layout that is not proportional in the Y axis. Then just make sure your icons are the same size.

1 Like

how to center icon in a button?

You should be able to do it with a dynamic insets component with 0.5 all around.

1 Like