Package com.badlogic.gdx.scenes.scene2d.ui

Examples of com.badlogic.gdx.scenes.scene2d.ui.Table


    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 );
View Full Code Here


    } );
  }

  private Table buildTopPanel( NinePatchDrawable back, float width, float height ) {

    Table p = ResourceFactory.newTable();
    p.setSize( width, 155 );
    p.defaults().pad( 5, 25, 5, 0 ).align( Align.top );
    p.left();
    p.setBackground( back );

    return p;
  }
View Full Code Here

    } );

    sbBackground.setSelectedIndex( DefaultBackground );
    selectBoxes.add( sbBackground );

    Table t = ResourceFactory.newTable();
    t.add( cbPost ).colspan( 2 ).left();
    t.row();
    t.add( ResourceFactory.newLabel( "Background " ) );
    t.add( sbBackground );
    t.row();
    t.add( cbBackgroundAffected ).colspan( 2 ).left();
    t.row();
    t.add( cbSprite ).colspan( 2 ).left();

    return t;
  }
View Full Code Here

            Slider source = (Slider)event.getListenerActor();
            post.bloom.setBloomSaturation( source.getValue() );
          }
        } );

    Table t = ResourceFactory.newTable();
    t.add( cbBloom ).colspan( 2 ).center();
    t.row();
    t.add( ResourceFactory.newLabel( "threshold " ) ).left();
    t.add( slBloomThreshold );
    t.row();
    t.add( ResourceFactory.newLabel( "base int " ) ).left();
    t.add( slBloomBaseI );
    t.row();
    t.add( ResourceFactory.newLabel( "base sat " ) ).left();
    t.add( slBloomBaseS );
    t.row();
    t.add( ResourceFactory.newLabel( "bloom int " ) ).left();
    t.add( slBloomBloomI );
    t.row();
    t.add( ResourceFactory.newLabel( "bloom sat " ) ).left();
    t.add( slBloomBloomS );

    return t;
  }
View Full Code Here

            Slider source = (Slider)event.getListenerActor();
            post.curvature.setZoom( 2f - source.getValue() );
          }
        } );

    Table t = ResourceFactory.newTable();
    t.add( cbCurvature ).colspan( 2 ).center();
    t.row();
    t.add( ResourceFactory.newLabel( "Distortion " ) ).left();
    t.add( slCurvatureDist );
    t.row();
    t.add( ResourceFactory.newLabel( "Zoom " ) ).left();
    t.add( slCurvatureZoom );

    return t;
  }
View Full Code Here

        tint.b = source.getValue();
        post.crt.setTint( tint );
      }
    } );

    Table t = ResourceFactory.newTable();
    t.add( cbCrt ).colspan( 2 ).center();
    t.row();
    t.add( ResourceFactory.newLabel( "Chromatic dispersion R/C " ) ).left();
    t.add( slCrtDispersionRC );
    t.row();
    t.add( ResourceFactory.newLabel( "Chromatic dispersion B/Y " ) ).left();
    t.add( slCrtDispersionBY );
    t.row();
    t.add( ResourceFactory.newLabel( "Tint (R) " ) ).left();
    t.add( slCrtTintR );
    t.row();
    t.add( ResourceFactory.newLabel( "Tint (G) " ) ).left();
    t.add( slCrtTintG );
    t.row();
    t.add( ResourceFactory.newLabel( "Tint (B) " ) ).left();
    t.add( slCrtTintB );

    return t;
  }
View Full Code Here

              post.vignette.setLutIndexVal( 0, -1 );
            }
          }
        } );

    Table t = ResourceFactory.newTable();
    t.add( cbVignette ).colspan( 2 ).center();
    t.row();
    t.add( ResourceFactory.newLabel( "Intensity " ) ).left();
    t.add( slVignetteI );
    t.row();
    t.add( cbGradientMapping ).padTop( 10 ).colspan( 2 ).center();
    t.row();
    t.add( ResourceFactory.newLabel( "Gradient " ) ).center().padTop( 10 );
    t.add( sbGradientMap ).padTop( 10 );

    return t;
  }
View Full Code Here

          post.zoomRadialBlur = false;
        }
      }
    } );

    Table t = ResourceFactory.newTable();
    t.add( cbZoomer );
    t.row();
    t.add( cbZoomerDoBlur );

    return t;
  }
View Full Code Here

          panelShown = false;
        }
      }
    } );

    Table t = ResourceFactory.newTable();
    t.row().padTop( 55 );
    t.add( btnShowHide );

    return t;
  }
View Full Code Here

    return t;
  }

  private Table buildBottomPanel( NinePatchDrawable back, float width, float height ) {
    Table t = ResourceFactory.newTable();
    t.setSize( width, 130 );
    t.defaults().pad( 10, 15, 0, 15 ).align( Align.top ).expandY();
    t.setY( -98 );
    t.left();
    t.setBackground( back );

    return t;
  }
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.scenes.scene2d.ui.Table

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.