java - Scene2d progress bar not resizing -
i added progress bar stage, , gets default width expected. however, want change width bit, reason libgdx don't. i've tried setsize, setwidth, setminwidth @ background of progress bar , changing texture. nothing works. thing can change size of, knob.
here's code:
background = new texture("progress_bar_texture"); knob = new texture("knob_texture"); progressbar.progressbarstyle pbs = new progressbar.progressbarstyle(); pbs.background = new textureregiondrawable(new textureregion(background)); pbs.knob = new textureregiondrawable(new textureregion(knob)); pbs.knobafter = pbs.knob; progressbar = new progressbar(0f, 80f, 1f, false, pbs); progressbar.setwidth(400); // doesn't change @ all... table.add(progressbar).right().colspan(1).expandx().padright(40);
anton, can increase width of progressbar within table using 1. .colspan(2) or 2.table.setwidth(). if want precise (pixel-perfect) control of position , size of progressbar, add group instead of table - things tried ( setsize, setwidth, setminwidth @ background of progress bar) work.
Comments
Post a Comment