Java 类com.badlogic.gdx.scenes.scene2d.ui.Skin 实例源码

项目:ProjektGG    文件:LoadingScreen.java   
private void onFinishedLoading() {
    BitmapFont main19Font = assetManager.get(MAIN_FONT_19_PATH());
    BitmapFont main22Font = assetManager.get(MAIN_FONT_22_PATH());
    BitmapFont letter20Font = assetManager.get(LETTER_FONT_20_PATH());
    BitmapFont handwritten20Font = assetManager
            .get(HANDWRITTEN_FONT_20_PATH());

    ObjectMap<String, Object> fontMap = new ObjectMap<String, Object>();
    fontMap.put("main-19", main19Font);
    fontMap.put("main-22", main22Font);
    fontMap.put("letter-20", letter20Font);
    fontMap.put("handwritten-20", handwritten20Font);
    assetManager.load(SKIN_PATH, Skin.class,
            new SkinLoader.SkinParameter(SKIN_TEXTURE_ATLAS_PATH, fontMap));
    assetManager.finishLoadingAsset(SKIN_PATH);

    // game.setUISkin(assetManager.get(SKIN_PATH));
    VisUI.load();
    game.setUISkin(VisUI.getSkin());

    // Notify loaded screens
    game.getScreen("serverBrowser").finishLoading();

    game.pushScreen("mainMenu");
}
项目:Hexpert    文件:BuildingScoreDialog.java   
public BuildingScoreDialog(Hexpert hexpert, Skin skin) {
    super(hexpert, skin, false);

    getContentTable().defaults().pad(15);
    Label.LabelStyle lblStyle = skin.get("bigger", Label.LabelStyle.class);
    Label lblExplaination = new Label(hexpert.i18NBundle.get("tut_score"), skin);
    lblExplaination.setWrap(true);
    lblExplaination.setAlignment(Align.center);
    getContentTable().add(lblExplaination).colspan(8).width(8*160);
    lblExplaination.setWrap(true);
    getContentTable().row();

    for (int i = 1; i < BuildingType.values().length; i++) {
        BuildingType buildingType = BuildingType.values()[i];
        Image image = new Image(new TextureRegion((Texture)
                hexpert.assetManager.get(SPRITE_FOLDER + buildingType.name().toLowerCase() + "_min.png")));

        getContentTable().add(image).width(160).height(160);
        Label lblScore = new Label(Integer.toString(buildingType.getScore()), lblStyle);
        lblScore.setAlignment(Align.center);
        getContentTable().add(lblScore).expand();
        if (i % 4 == 0)
            getContentTable().row();
    }
}
项目:LD38-Compo    文件:LudumDare38.java   
private void createResetButton()
{
    Skin skin = new Skin();
    Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
    pixmap.setColor(Color.WHITE);
    pixmap.fill();
    skin.add("white", new Texture(pixmap));
    skin.add("default", new BitmapFont());

    TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
    textButtonStyle.up = skin.newDrawable("white", new Color(0, 0, 0, 1));
    textButtonStyle.font = skin.getFont("default");
    skin.add("default", textButtonStyle);

    btnReset = new TextButton("RESET", skin);
    btnReset.setX(5);
    btnReset.setY(Gdx.graphics.getHeight() - 25);
    btnReset.setWidth(60);
    btnReset.setVisible(true);
    group.addActor(btnReset);
}
项目:LD38-Compo    文件:LudumDare38.java   
private void createUndoButton()
{
    Skin skin = new Skin();
    Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
    pixmap.setColor(Color.WHITE);
    pixmap.fill();
    skin.add("white", new Texture(pixmap));
    skin.add("default", new BitmapFont());

    TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
    textButtonStyle.up = skin.newDrawable("white", new Color(0, 0, 0, 1));
    textButtonStyle.font = skin.getFont("default");
    skin.add("default", textButtonStyle);

    btnUndo = new TextButton("UNDO", skin);
    btnUndo.setX(70);
    btnUndo.setY(Gdx.graphics.getHeight() - 25);
    btnUndo.setWidth(60);
    btnUndo.setVisible(true);
    group.addActor(btnUndo);
}
项目:Catan    文件:CatanGame.java   
@Override
public void create() {
    batch = new SpriteBatch();

    // Load the UI skin
    skin = new Skin(Gdx.files.internal("skin/uiskin.json"));

    clickSound = Gdx.audio.newSound(Gdx.files.internal("sound/buttonClick.mp3"));
    menuMusic = Gdx.audio.newMusic(Gdx.files.internal("sound/menuMusic.mp3"));
    menuMusic.setLooping(true);

    // Load the current account if cached
    account = AccountManager.getLocalAccount();
    // The first screen that shows up when the game starts
    Screen mainScreen = account == null ? new LoginScreen(this) : new MenuScreen(this);
    setScreen(mainScreen);
}
项目:blueirisviewer    文件:MainOptionsWnd.java   
private void AddWindowButton(final UIElement window, String buttonText, Skin skin, Table table)
{
    final TextButton btn = new TextButton(buttonText, skin);

    btn.addListener(new ChangeListener()
    {
        @Override
        public void changed(ChangeEvent event, Actor actor)
        {
            if (window.isShowing())
                window.hide();
            else
                window.show();
        }
    });

    table.add(btn);
    table.row();
}
项目:GDX-Engine    文件:BuildWeaponGUI.java   
@Override
   protected void onBuild(Skin skin) {
btnAddGun = new TextButton("Add Gun Lv.1 ($" + GameSpecs.gun_cost_first
    + ")", skin);
row().fill().expandX();
add(btnAddGun).expandX();
btnAddCanon = new TextButton("Add Canon Lv.1 ($"
    + GameSpecs.canon_cost_first + ")", skin);
row().fill().expandX();
add(btnAddCanon).expandX();
btnAddSlower = new TextButton("Add Slower Lv.1 ($"
    + GameSpecs.slower_cost_first + ")", skin);
row().fill().expandX();
add(btnAddSlower).expandX();
super.onBuild(skin);
   }
项目:GDX-Engine    文件:GameDialog.java   
public GameDialog(Skin skin) {
super("", skin);

waveLevel = new Label("", skin);
monsHP = new Label("", skin);
monsBonus = new Label("", skin);
monsSpeed = new Label("", skin);
monsNumber = new Label("", skin);
btnOK = new TextButton("Okay, Let them come!", skin);
btnOK.addListener(new ChangeListener() {

    @Override
    public void changed(ChangeEvent event, Actor actor) {
    // TODO Auto-generated method stub
    setVisible(false);

    }
});
setTitle(" There are more monsters are coming to you... ");
   }
项目:Hexpert    文件:ActionDialog.java   
public ActionDialog(Label text, Action action, I18NBundle bundle, Skin skin, Hexpert hexpert) {
    super(hexpert, skin);
    this.action = action;

    getBackground().setMinWidth(1000);
    getBackground().setMinHeight(400);
    text.setWrap(true);
    text.setAlignment(Align.center);

    getContentTable().add(text).width(getBackground().getMinWidth()).expandX();

    getButtonTable().defaults().width(200).height(120).pad(15);

    TextButton textButtonYes = new TextButton(bundle.get("yes"), skin);
    getButtonTable().add(textButtonYes);
    setObject(textButtonYes, 1);
    TextButton textButtonNo = new TextButton(bundle.get("no"), skin);
    getButtonTable().add(textButtonNo);
    setObject(textButtonNo, null);
}
项目:enklave    文件:ProgressBarEnergy.java   
public void updateVisual(){
    Skin skin = new Skin();
    Pixmap pixmap = new Pixmap(1,(int)(Gdx.graphics.getHeight()*0.0175), Pixmap.Format.RGBA8888);
    switch (infoProfile.getDateUserGame().getFaction()){
        case 1:{
            pixmap.setColor(1, 0f, 0f, 1);
            break;
        }
        case 2:{
            pixmap.setColor(0f, 0.831f, 0.969f,1f);
            break;
        }
        case 3:{
            pixmap.setColor(0.129f, 0.996f, 0.29f,1);
            break;
        }
    }
    pixmap.fill();
    skin.add("blue", new Texture(pixmap));
    ProgressBar.ProgressBarStyle style = new ProgressBar.ProgressBarStyle(bar.getStyle().background,skin.newDrawable("blue",Color.WHITE));
    style.knobBefore = style.knob;
    bar.setStyle(style);
}
项目:GangsterSquirrel    文件:MenuScreen.java   
public MenuScreen(MainGameClass game) {
    this.game = game;

    stage = new Stage(new ScreenViewport());
    Gdx.input.setInputProcessor(stage);

    skin = new Skin(Gdx.files.internal("skins/Flat_Earth_UI_Skin/flatearthui/flat-earth-ui.json"));

    progressBarStyle = skin.get("fancy", ProgressBar.ProgressBarStyle.class);
    TiledDrawable tiledDrawable = skin.getTiledDrawable("slider-fancy-knob").tint(skin.getColor("selection"));
    tiledDrawable.setMinWidth(0);
    progressBarStyle.knobBefore = tiledDrawable;

    sliderStyle = skin.get("fancy", Slider.SliderStyle.class);
    sliderStyle.knobBefore = tiledDrawable;

    layoutTable = new Table();
    layoutTable.top();
    layoutTable.setFillParent(true);
    layoutTable.pad(getPixelSizeFromDensityIndependentPixels(50));
}
项目:Hexpert    文件:TileEffectDialog.java   
public TileEffectDialog(Hexpert hexpert, Skin skin) {
    super(hexpert, skin, false);
    getContentTable().defaults().pad(15);

    for(int i = 0; i < TileType.values().length; i++)
    {
        TileType tileType = TileType.values()[i];
        Image tileImage = new Image(new TextureRegion((Texture) hexpert.assetManager.get(SPRITE_FOLDER + tileType.name().toLowerCase() + "_tile.png")));
        getContentTable().add(tileImage).width(96).height(96);

        Label lblDesc = new Label(hexpert.i18NBundle.get(tileType.name().toLowerCase() + "_effect"), skin);
        lblDesc.setAlignment(Align.center);
        getContentTable().add(lblDesc);
        getContentTable().row();
    }
}
项目:Polymorph    文件:DeathScreen.java   
public void initButtons(int score,TextureAtlas buttonAtlas) {
    Skin buttonSkin = new Skin();
    buttonSkin.addRegions(buttonAtlas);

    //TODO FIX THIS SHIT INDENTATION
    //TODO Long-term fix the magic numbers
    ImageButton playButton = new ImageButton(buttonSkin.getDrawable("playbutton"),
                                                                    buttonSkin.getDrawable("playbutton"));
    playButton.setSize(256, 64);
    playButton.setPosition(screenSize.width/2-playButton.getWidth()/2,
                           screenSize.height/2-playButton.getHeight()/2+50);
    playButton.addListener(new InputListener() {

        @Override
        public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
            polymorph.setScreen(new GameScreen(polymorph));
            DeathScreenMusic.stop();
            return true;
        }
    });

    stage.addActor(playButton);

}
项目:MMORPG_Prototype    文件:StringValueLabel.java   
public StringValueLabel(CharSequence text, Skin skin, T value)
{
    super(text, skin);
    this.value = value;
    originalText = text.toString();
    update();
}
项目:bobbybird    文件:Core.java   
public void loadAssets() {
    assetManager.clear();

    assetManager.load(DATA_PATH + "/skin/skin.json", Skin.class);

    for (String directory : imagePacks.keys()) {
        FileHandle folder = Gdx.files.local(directory);
        for (FileHandle file : folder.list()) {
            assetManager.load(file.path(), Pixmap.class);
            imagePacks.get(directory).add(file.nameWithoutExtension());
        }
    }

    assetManager.load(DATA_PATH + "/gfx/white.png", Pixmap.class);

    assetManager.load(DATA_PATH + "/sfx/coin.wav", Sound.class);
    assetManager.load(DATA_PATH + "/sfx/hit.wav", Sound.class);
    assetManager.load(DATA_PATH + "/sfx/jump.wav", Sound.class);
}
项目:FlappySpinner    文件:GameButton.java   
public GameButton(float WIDTH, float HEIGHT, String drawable, boolean isCheckable) {
    audioManager = AudioManager.getInstance();
    skin = new Skin();
    skin.addRegions(AssetsManager.getTextureAtlas());

    Button.ButtonStyle buttonStyle = new Button.ButtonStyle();
    buttonStyle.up = skin.getDrawable(drawable);
    buttonStyle.down = skin.getDrawable(drawable + "_pressed");
    if (isCheckable) {
        buttonStyle.checked = skin.getDrawable(drawable + "_pressed");
    }
    setStyle(buttonStyle);
    setSize(WIDTH, HEIGHT);

    rectangle = new Rectangle(getX(),getY(),getWidth(),getHeight());
    addListener(new ClickListener(){
        @Override
        public void clicked(InputEvent event, float x, float y) {
            super.clicked(event, x, y);
            audioManager.playSound(audioManager.getButtonSound());
        }
    });
}
项目:Hexpert    文件:ObjectiveDialog.java   
public ObjectiveDialog(Skin skin, Hexpert hexpert) {
    super(hexpert, skin);
    getBackground().setMinWidth(1000);

    final TextButton textButtonOK = new TextButton(hexpert.i18NBundle.get("ok"), skin);

    textButtonOK.addListener(new ClickListener(){

        @Override
        public void clicked(InputEvent event, float x, float y) {
            textButtonOK.setChecked(false);
        }
    });
    setObject(textButtonOK, null);
    getButtonTable().add(textButtonOK);

    getContentTable().defaults().pad(5, 0, 5, 15);
    getContentTable().top();
}
项目:ExamensArbeteTD    文件:LeftSection.java   
public LeftSection(Skin skin) {
    this.setSkin(skin);

       Table moneyStatPanel = new StatPanel(skin);
       Image coin = new Image(skin , "coin");
       moneyLabel = new Label("",skin , "fontHemi20" , "white");
       moneyStatPanel.add(coin).pad(5).align(Align.left).expand().size(23 , 21);
       moneyStatPanel.add(moneyLabel).align(Align.right).pad(5 , 5 , 5 ,10).expand();
       this.add(moneyStatPanel).align(Align.right).size(120 , 30).spaceBottom(2).row();
       Table grayPanel = new GrayPanel(skin);
       _laserTowerIcon = new Image(skin , "laser-tower-icon");
       _plastmaTowerIcon = new Image(skin , "plastma-tower-icon");
       _missleTurretIcon = new Image(skin,"missile-tower-icon");

       _laserTowerTooltipTable = new LaserTowerTooltipTable(skin, TowerType.BASIC_LASER_TURRET);
       _plastmaTowerTooltipTable = new PlastmaTowerTooltipTable(skin, TowerType.PLASTMA_TOWER);
       _missileTowerTooltipTable = new MissileTowerTooltipTable(skin, TowerType.MISSILE_TURRET);

       _laserTowerIcon.addListener(_laserTowerTooltipTable.getTooltip());
       _plastmaTowerIcon.addListener(_plastmaTowerTooltipTable.getTooltip());
       _missleTurretIcon.addListener(_missileTowerTooltipTable.getTooltip());
       grayPanel.add(_laserTowerIcon).size(32,32).pad(10).align(Align.topLeft);
       grayPanel.add(_plastmaTowerIcon).size(32,32).pad(10).align(Align.topLeft);
       grayPanel.add(_missleTurretIcon).size(32, 32).pad(10).align(Align.topLeft).expand(32,32);
       this.add(grayPanel).expand();
}
项目:ExamensArbeteTD    文件:PauseWindow.java   
public PauseWindow(String title, Skin skin) {
    super(title, skin);
       this.setVisible(false);
       primaryMenu = new Table(skin);
       settingsPanel = new SettingsPanel(skin);
       _okButton  = new TextButton("OK" , skin , "menu");
       settingsPanel.add(_okButton);
       _resumeButton = new TextButton("Resume",Assets._skin , "menu");
       _mainMenuButton = new TextButton("Main Menu",Assets._skin , "menu");
       _settingsButton = new TextButton("Settings",Assets._skin , "menu");

       primaryMenu.add(_resumeButton).padBottom(20f).row();
       primaryMenu.add(_settingsButton).padBottom(20f).row();
       primaryMenu.add(_mainMenuButton);
       this.add(primaryMenu).align(Align.center).fill();
}
项目:cocos2d-java    文件:GdxUISkin.java   
public Skin getSkin(String path) {
    for(int i = 0; i < skins.size; ++i) {
        StructSkin ss = skins.get(i);
        if(path.equals(ss.first)) {
            return ss.second;
        }
    }
    return null;
}
项目:cocos2d-java    文件:GdxUIConsole.java   
@Override
protected void onInitUI() {
    Skin skin = GdxUISkin.instance().getDeafult();
    input = new TextField("", skin);

    ClickListener mClickListener = new ClickListener() {
        public boolean keyDown (InputEvent event, int keycode) {
            if(keycode == Keys.ENTER && !isHide()) {
                if(!handleCmdString(input.getText())) {
                    //clear input 
                    input.setText(null);
                }
            }
            return true;
        }
    };
    input.addCaptureListener(mClickListener);

    input.setTextFieldFilter(new TextFieldFilter() {
        @Override
        public boolean acceptChar(TextField textField, char c) {
            if(c == '`' || c == '~') {
                hide();
                return false;
            }
            return true;
        }
    });
    label = new Label("", skin);

    maxTmp = GdxUIConfig.instance().consoleMaxOutputLine;

    input.setSize(getUIWidth()/2, 32);
    input.setPosition(20, getUIHeight() * 0.25f);
    addUI(input);
    addUI(label);

    skin = null;
}
项目:Catan    文件:CatanWindow.java   
/**
 * Create a new window
 *
 * @param title the title of the window - must not be null
 * @param skin  skin used for theming the window
 */
public CatanWindow(String title, Skin skin) {
    super(title, skin, title.isEmpty() ? "no-title" : "default");
    width = 3f / 4f * Gdx.graphics.getWidth();
    height = 3f / 4f * Gdx.graphics.getHeight();
    init();
}
项目:feup-lpoo-armadillo    文件:Armadillo.java   
/**
 * {@inheritDoc}
 */
@Override
public void create() {
    batch = new SpriteBatch();
    assetManager = new AssetManager();

    skin1 = new Skin(Gdx.files.internal("appearance/Armadillo.json"), new TextureAtlas("appearance/Armadillo.atlas"));
    skin2 = new Skin(Gdx.files.internal("appearance/smallBtn.json"), new TextureAtlas("appearance/smallBtn.atlas"));

    loadAssets();
    setMusic();
    startGame();
}
项目:Hexpert    文件:FreeridingDialog.java   
public FreeridingDialog(final Hexpert hexpert, Skin skin)
{
    super(hexpert, skin.get("gold", WindowStyle.class));

    getBackground().setMinWidth(1400);
    I18NBundle i18N = hexpert.i18NBundle;
    Label lblRate = new Label(i18N.get("freerider"), skin.get("bigger", Label.LabelStyle.class));
    lblRate.setAlignment(Align.center);
    lblRate.setWrap(true);
    getContentTable().add(lblRate).width(1200);

    TextButton.TextButtonStyle goldenStyle = skin.get("gold", TextButton.TextButtonStyle.class);


    TextButton textButtonRate = new TextButton(i18N.get("rate"), goldenStyle);
    getButtonTable().add(textButtonRate).width(textButtonRate.getLabelCell().getPrefWidth() + 30);


    TextButton textButtonNo = new TextButton(i18N.get("no"), goldenStyle);
    getButtonTable().add(textButtonNo);
    setObject(textButtonNo, null);

    textButtonRate.addListener(new ClickListener(){
        @Override
        public void clicked(InputEvent event, float x, float y) {
            hexpert.playServices.rateGame();
            hide();
        }
    });

    setObject(textButtonRate, null);
}
项目:conquest    文件:NumberField.java   
NumberField(String text, Skin skin) {
    super(text, skin);
    setSize(115, 40);
    setPosition(Gdx.graphics.getWidth() / 3 - getWidth() / 2, Gdx.graphics.getHeight() / 2 + getHeight() / 4);
    setAlignment(Align.center);
    setTextFieldFilter(new TextFieldFilter.DigitsOnlyFilter());
}
项目:blueirisviewer    文件:UIElement.java   
public UIElement(Skin skin)
{
    UI.uiElements.add(this);
    parent = new Table();
    parent.setFillParent(true);
    window = new Window("Unnamed Window", skin);
    window.setModal(BlueIrisViewer.bivSettings.modalUI);
    table = new Table(skin);
    window.add(table);

    hide();

    parent.add(window);
    onCreate(skin, window, table);
}
项目:GDX-Engine    文件:UIManager.java   
public UIManager(String title, Skin skin,IGameService service) {
    super();

    mainMenu = new Window(title, skin);
    addActor(mainMenu);

    this.components = getRoot();
    this.batch = getSpriteBatch();

    this.service = service;
}
项目:GDX-Engine    文件:GuiManager.java   
public GuiManager(Skin skin, UIManager manager) {
super();

buildTowerGUI = new BuildTowerGUI(skin);
add("buildTower", buildTowerGUI);
buildWeaponGUI = new BuildWeaponGUI(skin);
add("addWeapon", buildWeaponGUI);

editTowerGUI = new EditWeaponGUI(skin);
add("editWeapon", editTowerGUI);

manager.addActor(buildWeaponGUI);
manager.addActor(buildTowerGUI);
manager.addActor(editTowerGUI);
   }
项目:GDX-Engine    文件:BuildTowerGUI.java   
@Override
   protected void onBuild(Skin skin) {
btnAddTower = new TextButton("",skin);
btnAddTower.setText("Add Tower ($100)");
row().fill().expandX();
add(btnAddTower).expandX();
super.onBuild(skin);
   }
项目:SpaceChaos    文件:SkinFactory.java   
public static Skin createSkin(final String jsonFile) {
    Skin skin = new Skin(Gdx.files.absolute(jsonFile));
    skin.getAtlas().getTextures().iterator().next().setFilter(Texture.TextureFilter.Nearest,
            Texture.TextureFilter.Nearest);
    skin.getFont("default-font").getData().markupEnabled = true;
    float scale = 1;
    skin.getFont("default-font").getData().setScale(scale);

    return skin;
}
项目:CursedEcho    文件:CursedEchoController.java   
private void initTouchPad() {
    touchpadSkin = new Skin();
    touchpadSkin.add("touchBackground", GameUtils.getGame().assetHandler.get("Controls/touchBackground.png",Texture.class));
    touchpadSkin.add("touchKnob", GameUtils.getGame().assetHandler.get("Controls/touchKnob.png",Texture.class));
    touchpadStyle = new TouchpadStyle();
    touchBackground = touchpadSkin.getDrawable("touchBackground");
    touchKnob = touchpadSkin.getDrawable("touchKnob");
    touchpadStyle.background = touchBackground;
    touchpadStyle.knob = touchKnob;
    touchpad = new Touchpad(10, touchpadStyle);
    touchpad.setBounds(15, 15, 200, 200);

}
项目:gdx-cclibs    文件:ExampleRunner.java   
@Override
public void create() {
    spriteBatch = new SpriteBatch();
    stage = new Stage(new ScreenViewport());
    skin = new Skin(Gdx.files.internal("uiskin.json"));
    Table table = new Table(skin);
    table.setFillParent(true);
    selectBox = new SelectBox<Class<? extends Example>>(skin){
        protected String toString (Class<? extends Example> obj) {
            return obj.getSimpleName();
        }
    };
    selectBox.setItems(examples);
    table.add(selectBox).fillX().space(20).row();
    stage.addActor(table);
    TextButton startButton = new TextButton("Start example", skin);
    startButton.addListener(new ChangeListener() {
        @Override
        public void changed(ChangeEvent event, Actor actor) {
            runSelectedExample();
        }
    });
    table.add(startButton).fillX();

    if (arg != null && arg.length > 0) {
        Class<? extends Example> specifiedExample = getExample(arg[0]);
        if (specifiedExample != null){
            startExample(specifiedExample);
            return;
        }
    }

    setScreen(menuScreen);
}
项目:gdx-cclibs    文件:FlexBatchTest.java   
private void setupUI() {
    stage = new Stage(new ScreenViewport(), quad2dBatch);
    skin = new Skin(Gdx.files.internal("uiskin.json"));

    final SelectBox<Test> selectBox = new SelectBox<Test>(skin);
    selectBox.setItems(Test.values());
    selectBox.addListener(new ChangeListener() {
        public void changed(ChangeEvent event, Actor actor) {
            test = selectBox.getSelected();
            elapsed = 0;
        }
    });
    Table table = new Table();
    table.setFillParent(true);
    table.defaults().padTop(5).left();
    table.top().left().padLeft(5);
    table.add(selectBox).row();
    table.add(new Label("", skin) {
        int fps = -1;

        public void act(float delta) {
            super.act(delta);
            if (Gdx.graphics.getFramesPerSecond() != fps) {
                fps = Gdx.graphics.getFramesPerSecond();
                setText("" + fps);
            }
        }
    }).row();
    stage.addActor(table);
}
项目:Particles    文件:IntroScreen.java   
IntroScreen(final ParticleGame game) {
    particle_game = game;
    stage = new Stage();
    table = new Table();

    table.setFillParent(true);
    table.setDebug(true);
    stage.addActor(table);

    Skin skin = new Skin();

    Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
    pixmap.setColor(Color.WHITE);
    pixmap.fill();

    skin.add("white", new Texture(pixmap));
    skin.add("font", game.getFont());

    TextButton.TextButtonStyle text_button_style = new TextButton.TextButtonStyle();
    final Color button_color = new Color(226 / 255f, 226 / 255f, 226 / 255f, 1f);
    final Color hover_color = new Color(162 / 255f, 162 / 255f, 162 / 255f, 1f);
    text_button_style.up = skin.newDrawable("white", button_color);
    text_button_style.down = skin.newDrawable("white", button_color);
    text_button_style.over = skin.newDrawable("white", hover_color);
    text_button_style.font = skin.getFont("font");
    skin.add("default", text_button_style);

    TextButton play_button = new TextButton("play", skin);
    play_button.addListener(new ChangeListener() {
        @Override
        public void changed(ChangeEvent event, Actor actor) {
            particle_game.setScreen(particle_game.getGameSetupScreen());
        }
    });
    table.add(play_button);
}
项目:Particles    文件:ParticleChoiceScreen.java   
ParticleChoiceScreen(final ParticleGame p, final GameScreen g) {
    game = p;
    game_screen = g;

    camera = new OrthographicCamera(PARTICLE_BOARD_W, PARTICLE_BOARD_W);
    camera.position.set(PARTICLE_BOARD_W / 2, PARTICLE_BOARD_W / 2, 0);
    camera.update();

    initStage();
    initTable();

    Skin skin = new Skin();

    Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
    pixmap.setColor(Color.WHITE);
    pixmap.fill();
    skin.add("white", new Texture(pixmap));
    skin.add("default", game.getFont());

    TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
    final Color buttonColor = new Color(226 / 255f, 226 / 255f, 226 / 255f, 1f);
    final Color hoverColor = new Color(162 / 255f, 162 / 255f, 162 / 255f, 1f);
    textButtonStyle.up = skin.newDrawable("white", buttonColor);
    textButtonStyle.down = skin.newDrawable("white", buttonColor);
    textButtonStyle.over = skin.newDrawable("white", hoverColor);
    textButtonStyle.font = skin.getFont("default");
    skin.add("default", textButtonStyle);

    Label.LabelStyle labelStyle = new Label.LabelStyle();
    labelStyle.font = game.getFont();
    labelStyle.fontColor = Color.WHITE;
    skin.add("default", labelStyle);

    // initTableContents(skin);
}
项目:MMORPG_Prototype    文件:Assets.java   
public static void dispose()
{
    assets.dispose();
    font.dispose();
    stages.clear();
    batch.dispose();
    for (Skin skin : skins.values())
        skin.dispose();
}
项目:fluffybalance    文件:BalanceBallSec.java   
private void initGuiResources() {
    FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("kenvector_future.ttf"));
    FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter();
    parameter.size = (int) (16.f * Gdx.graphics.getDensity());
    mFont = generator.generateFont(parameter);
    generator.dispose();

    mSkin = new Skin(Gdx.files.internal("skin/flat-earth-ui.json"));
}
项目:retro-reversi    文件:Reversi.java   
@Override
public void create () {
    batch = new SpriteBatch();
       assetManager = new AssetManager();
    viewport = new ExtendViewport(512, 854);

       atlas = new TextureAtlas("retro-normal-font/retro-normal-font.atlas");
       skin = new Skin(Gdx.files.internal("retro-normal-font/retro-normal-font.json"), atlas);
    loadAssets();

       playServices.signIn();
    setScreen(new MainMenuView(this));
}
项目:bobbybird    文件:MenuState.java   
@Override
public void start() {
    skin = getCore().getAssetManager().get(Core.DATA_PATH + "/skin/skin.json", Skin.class);
    stage = new Stage(new ScreenViewport());

    Gdx.input.setInputProcessor(stage);

    Image bg = new Image(skin, "sky");
    bg.setFillParent(true);
    stage.addActor(bg);

    createBG();

    createMenu();
}
项目:bobbybird    文件:LoadingState.java   
private Skin createSkin() {
    Skin returnValue = new Skin();

    returnValue.add("bg", createDrawable(20, 20, Color.DARK_GRAY), Drawable.class);
    returnValue.add("progress-bar-back", createDrawable(20, 20, Color.BLACK), Drawable.class);
    returnValue.add("progress-bar", createDrawable(1, 20, Color.BLUE), Drawable.class);

    ProgressBarStyle progressBarStyle = new ProgressBarStyle();
    progressBarStyle.background = returnValue.getDrawable("progress-bar-back");
    progressBarStyle.knobBefore = returnValue.getDrawable("progress-bar");

    returnValue.add("default-horizontal", progressBarStyle);

    return returnValue;
}