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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -