0
\$\begingroup\$

If I leave my imagebuttons' width and height alone I get larger buttons than I'd like:

    radio.setX(wu*35);
    radio.setY(hu*20);

enter image description here

When I replace/add to the lines above with setbounds or setWidth/setHeight functions, I get this:

    radio.setBounds(wu * 35, hu*20, wu * 12, hu * 12);

enter image description here

It did get smaller, but now it appears to be two images. What is going on? I always run into this issue, across multiple screens and projects. My attempts to resolve it include scaling the native images to be closer to the size I want them to appear in-game, and using the other button methods that deal with sizing, such as setScaleX.

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

After running this problem by the libGDX forum, the prevailing wisdom is that widgets were meant to be used inside tables. While I like the built-in functions provided by the button class, such as swapping out the images used on mouseover, mousedown, disabled, etc. events, I think I can duplicate this feature with the right listener and an Image actor.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .