scene2d - LibGDX - Actor group on scrollable table -


in game want draw 2-column table contains squares (like cards), , on them, 1 image , 2 labels (as row, @ top of card image, below 1 label , below other one).

if put images in scrollable table, desired result, i'm trying add image , label on background.

i have tried defining actor group , adding table, elements doesn't appear, extending image class , drawing other elements inside ondraw method, text doesn't move card background user scrolls.

my table code follows:

table scrolltable = new table();     scrolltable.align(align.topleft);      scrolltable.add(new highscoreitem(game, colors.orange, "1º:fer", 30))             .width(190).height(150).space(30);     scrolltable.add(new highscoreitem(game, colors.orange, "1º:fer", 30))             .width(190).height(150).space(30);     scrolltable.row();      scrolltable.add(new highscoreitem(game, colors.orange, "1º:fer", 30))             .width(190).height(150).space(30);     scrolltable.add(new highscoreitem(game, colors.orange, "1º:fer", 30))             .width(190).height(150).space(30);     scrolltable.row();      scrolltable.add(new highscoreitem(game, colors.orange, "1º:fer", 30))             .width(190).height(150).space(30);     scrolltable.add(new highscoreitem(game, colors.orange, "1º:fer", 30))             .width(190).height(150).space(30);     scrolltable.row();      scrolltable.add(new highscoreitem(game, colors.orange, "1º:fer", 30))             .width(190).height(150).space(30);     scrolltable.add(new highscoreitem(game, colors.orange, "1º:fer", 30))             .width(190).height(150).space(30);     scrolltable.row();      scrolltable.add(new highscoreitem(game, colors.orange, "1º:fer", 30))             .width(190).height(150).space(30);     scrolltable.add(new highscoreitem(game, colors.orange, "1º:fer", 30))             .width(190).height(150).space(30);     scrolltable.row();      scrollpane scroller = new scrollpane(scrolltable);     table table = new table();     table.setbounds(33, 10, 410, 500);     table.add(scroller).fill().expand();      getstage().addactor(table); 

highscoreitem class use in order display table item. if replace class regular scene2d image class displays fine, trying add other image , 2 labels on background (by making highscoreitem extend group or making extend image) problem. ideas on how that? thank you.

if want render actors on top of each other can use stack class.

stack stack = new stack(); stack.add( new image( new texture( "test.png" ) ) ); stack.add( new label( "label 1", skin ) ); stack.add( new label( "label 2", skin ) ); scrolltable.add( stack ); 

the offset top left of stack.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -