Nifty Gui

3 replies [Last post]
Offline
Joined: 11/18/2012


Nifty ScrollPanel Builder problem


how to make the scrollpanel update its content and make it scrollable. Im using the template you attached in your Lesson(ScreenFactory class).


thx 

Offline
Joined: 12/13/2010
What are you trying to do

What are you trying to do with the scrollpanel?  Do you want to change the content of the panel during runtime?  Do you some code I can look at?

 

Thanks

Offline
Joined: 11/18/2012
Codes


 control(new ScrollPanelBuilder("scorePanel"){
 {
                                                                                           
set("vertical","true");
set("horizontal","false");
set("childLayout","vertical");
alignCenter();
valignCenter();
width("100%");
height("100%");
text(new TextBuilder(){
{
                                                                                                   
textHAlignCenter();
textVAlignTop();
style("base-font");
width("100%");
height("100%");
color("#000000");
text(Game.content);
alignCenter();
valignCenter();
}
});                                                                                   
}
});

 

I want the scroll panel to update every start of the game and would display the ranking but the problem is the page content wont update once the page is full and is not scrollable. The Gui is showing the exact output but if the page content of the scroll panel is full the page wont increase its size. the content of Game.content is a string gathered from a text file.

Offline
Joined: 12/13/2010
I probably won't have time to

I probably won't have time to look at this until after the weekend.  However, I did find the nifty chatarea example which you may be able to adpot and change for your own purpose:

http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Standard_Controls_Chat_Control

 

Seems like the chatarea control is almost what you wanted to do...