Friday, 15 February 2013

What, other the .row() can cause a libgdx table to start a new row? -



What, other the .row() can cause a libgdx table to start a new row? -

bit of mystery me this, have table in libgdx beingness positioned in new cells vertically;

i not using .row() anywhere. doing stupid here cant see it. clues can cause this?

(i'll post code if needed, not neat, , seeing think knowing anything can cause newline help me, shouldn't needed)

edit tried cutting code downwards bits happen when item gets added

code;

//function triggers on adding

//sssnode semantic reference items details,it justs made label object

public void additem(sssnode itemsnode){ item newitem = new item(itemsnode); //item extends label allitems.add(newitem); super.add(newitem).size(60, 30).top().left().filly().expandy(); //pack(); //super.invalidate(); //super.validate(); (tried doing pack, validate, , none...neither helped) //update gui bar in case inventory tab isnt there yet mainexplorationview.usersgui.setdatavisible(true); }

the next code in "usersgui", creates , handles popup called inventory whats in image , table cant behave.

//ensures interface inventory popup setup , visible //also refreshes links public void setdatavisible(boolean visible){ if (mycontents.isvisible!=true){ mycontents.isvisible=visible; refreshlinks(); setupinventory(); } } private void refreshlinks() { super.clearchildren(); super.addactor(backgroundobject); super.addactor(me.playersinventory); //re adds inventory panel table? int y = 440; me.playersinventory.validate(); //revalidated table (i dumped everywhere in frustration) //below not relevant, updates other items in onscreen gui (interfacebutton link : alllinks) { if (link.isvisible==true){ link.setposition(5,y); super.addactor(link); y=y-30; } } backgroundobject.setsize(85, 200); backgroundobject.setposition(0,y+20); } //ensures inventory setup once. public void setupinventory() { if (setup){ return; } log.info("setupinventory"); me.playersinventory.setprefwidth(super.getwidth()); log.info("width "+super.getwidth()); me.playersinventory.setheight(200); me.playersinventory.pack(); float x = mycontents.getx(); float y = mycontents.gety()-me.playersinventory.getheight(); log.info("popping inventory at:"+x+","+y); me.playersinventory.setposition(x, y); super.validate(); setup=true; }

the total code on github; https://github.com/thomaswrobel/meshexplorergdx whole project game beingness made demo/test , open source distributed semantic database system. relevant bit inventory , maybe gui creates it.

anyone knowledge of libgdxs workings should think not need of code though if theres other things can tell table start new row. (ie, layout restrictions can cause happen automatically? )

layout ending current row side effect create layout logic simpler. fixed.

note horizontalgroup still improve fit utilize case , has benefit can add/remove actors @ index.

libgdx

No comments:

Post a Comment