NinePatch np = new NinePatch( ResourceFactory.newTexture( "brushed.png", false ), 0, 0, 0, 0 );
np.setColor( new Color( 0.3f, 0.3f, 0.3f, 1f ) );
NinePatchDrawable npBack = new NinePatchDrawable( np );
// build the top panel and add all of its widgets
Table topPanel = buildTopPanel( npBack, width, height );
topPanel.add( buildGlobalSettingsWidgets() );
topPanel.add( buildBloomWidgets() );
topPanel.add( buildCurvatureWidgets() );
topPanel.add( buildCrtEmulationWidgets() );
topPanel.add( buildVignettingWidgets() );
// the zoomer widgets group is somewhat "special": if we are going
// to NOT use a panel animator then one more button will be added
// to permit the user to show/hide the panel manually
Table tZoomer = buildZoomerWidgets();
// compute the panel's opened/closed position
final float yWhenShown = height - topPanel.getHeight() + 13;
final float yWhenHidden = height - 60 + 13;
if( usePanelAnimator ) {
panelShown = false;
panelAnimator = new TopPanelAnimator( topPanel, new Rectangle( 10, 5, width - 20, 60 ), yWhenShown, yWhenHidden );
topPanel.setY( yWhenHidden );
topPanel.add( tZoomer ).expandX();
topPanel.setColor( 1f, 1f, 1f, 0.5f );
} else {
panelShown = true;
topPanel.setY( yWhenShown );
topPanel.add( tZoomer ).expandX();
tZoomer.row();
tZoomer.add( buildPanelActionButtons( topPanel, yWhenShown, yWhenHidden ) ).align( Align.right );
}
// build the bottom panel
Table bottomPanel = buildBottomPanel( npBack, width, height );
bottomPanel.add( ResourceFactory.newLabel( "Press \"Q\" or \"Esc\" to quit" ) );
// fps label
fps = ResourceFactory.newLabel( "fps: " );
bottomPanel.add( fps ).width( 200 ).padLeft( 50 );
// general-purpose single message
singleMessage = ResourceFactory.newLabel( "" );
bottomPanel.add( singleMessage ).expandX().right();
// UI is quite ready at this point, just add the containers to the stage
stage.addActor( topPanel );
stage.addActor( bottomPanel );