java - Position Actor Bottom Right Of Viewport -


i using scene2d, , want position custom actor created, extends image , allows me play animations. having problems keeping actor in bottom right of screen. when shrink window out of 16:9 ratio, actor goes side (up on y axis) instead of staying in bottom. actor animactor (i created), work same image. trying make loading symbol. resize view port correctly. here's code :

    stage = new stage(viewport);     animation anim = main.loadingsymbol;     anim.setframesize(new vector2(camera.viewportwidth / 10, camera.viewportwidth / 10));     loadingsymbolactor = new animactor(anim);     table = new table(new skin());     table.setbounds(0, 0, stage.getwidth(), stage.getheight());     table.add(loadingsymbolactor);     table.pack();     table.align(align.bottomright);     stage.addactor(table); 

tables static ui layout, since not easy add/remove or move actors once laid out. there isn't can tell libgdx wiki doesn't, has explanation on tables here.

but if issue resizing, make sure update stage camera correctly in resize method. maybe change table bounds in resize method, , set table.setfillparent(true) after initialising table.

to fix actor bottom right of table, can try table.add(loadingsymbolactor).bottom().right();.


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) -