I can't figure out how to control the size of the checkboxes. Of course, in my Texture atlas you can create a different image size and accept the appropriate one, but I do not want to do this.
Here is my code:
AtlasRegion checkboxOn = AssetsHelper.textures.findRegion("checked"); AtlasRegion checkboxOff = AssetsHelper.textures.findRegion("unchecked"); CheckBoxStyle checkBoxStyle = new CheckBoxStyle(); checkBoxStyle.font = AssetsHelper.font66yellow; checkBoxStyle.checkboxOff = checkboxOff; checkBoxStyle.checkboxOn = checkboxOn; CheckBox cbSound = new CheckBox(" Sound", checkBoxStyle);
The cbSound object does not have such methods for displaying the flag image, but there is a getImage () method, but it does not seem to work either. This does not work:
cbSound.getImage().width = 120; cbSound.getImage().height = 120;
FYI: for example, when I wanted to draw an image, I liked:
batch.draw(textureRegion, 0, 0, widthIwant, heightIwant);
But in the CheckBox class, only this is overridden (without setting the width and height):
public void draw (SpriteBatch batch, float parentAlpha) { image.setRegion(isChecked ? style.checkboxOn : style.checkboxOff); super.draw(batch, parentAlpha); }
Question : how to change the width and height of the checkbox image?
Thanks in advance.
source share