当前位置: 首页>>代码示例>>Java>>正文


Java Skin.get方法代码示例

本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.Skin.get方法的典型用法代码示例。如果您正苦于以下问题:Java Skin.get方法的具体用法?Java Skin.get怎么用?Java Skin.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.scenes.scene2d.ui.Skin的用法示例。


在下文中一共展示了Skin.get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: BuildingScoreDialog

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //导入方法依赖的package包/类
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();
    }
}
 
开发者ID:MartensCedric,项目名称:Hexpert,代码行数:26,代码来源:BuildingScoreDialog.java

示例2: LockedDialog

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //导入方法依赖的package包/类
public LockedDialog(int currentGoals, int goalsNeeded, Hexpert hexpert, Skin skin) {
    super(hexpert, skin.get("gray", WindowStyle.class));
    getBackground().setMinWidth(1000);
    getBackground().setMinHeight(350);

    getContentTable().defaults().pad(25);

    TextButton.TextButtonStyle txtButtonStyle = skin.get("gray", TextButton.TextButtonStyle.class);

    Label label = new Label(hexpert.i18NBundle.format("locked_left", currentGoals, goalsNeeded), skin);
    getContentTable().add(label).top();

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

    textButtonOK.addListener(new ClickListener() {

        @Override
        public void clicked(InputEvent event, float x, float y) {
            textButtonOK.setChecked(false);
        }
    });
    setObject(textButtonOK, null);
    getButtonTable().add(textButtonOK);
}
 
开发者ID:MartensCedric,项目名称:Hexpert,代码行数:25,代码来源:LockedDialog.java

示例3: MenuScreen

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //导入方法依赖的package包/类
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));
}
 
开发者ID:johannesmols,项目名称:GangsterSquirrel,代码行数:22,代码来源:MenuScreen.java

示例4: FreeridingDialog

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //导入方法依赖的package包/类
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);
}
 
开发者ID:MartensCedric,项目名称:Hexpert,代码行数:33,代码来源:FreeridingDialog.java

示例5: LevelCompleteDialog

import com.badlogic.gdx.scenes.scene2d.ui.Skin; //导入方法依赖的package包/类
public LevelCompleteDialog(int score, String mapName, Skin skin, PlayScreen playScreen) {
    super(playScreen.getHexpert(), skin.get("gold", WindowStyle.class));

    this.playScreen = playScreen;
    this.score = score;
    lvlIndex = MapUtils.getLevelIndex(mapName);

    Image imageTrophy = new Image(new TextureRegion((Texture) hexpert.assetManager.get(TEXTURE_ACHIEVEMENTS)));
    TextButton.TextButtonStyle txtButtonStyle = skin.get("gold", TextButton.TextButtonStyle.class);
    I18NBundle bundle = hexpert.i18NBundle;
    Label content = new Label(lvlIndex > 4 ?
            bundle.get("all_objectives_finished") : bundle.get("all_objectives_finished_no_quit")
            , skin);

    content.setAlignment(Align.center);
    getBackground().setMinWidth(1000);
    getBackground().setMinHeight(600);
    content.setWrap(true);

    getContentTable().defaults().pad(25);

    getContentTable().add(imageTrophy).width(192).height(192);
    getContentTable().row();
    getContentTable().add(content).width(900);

    getButtonTable().defaults().pad(15);

    if(lvlIndex > 4) {

        TextButton textButtonYes = new TextButton(bundle.get("yes"), txtButtonStyle);
        setObject(textButtonYes, 1);
        getButtonTable().add(textButtonYes);

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

        TextButton textButtonShare = new TextButton(bundle.get("share"), txtButtonStyle);
        setObject(textButtonShare, 2);
        getButtonTable().add(textButtonShare).width(textButtonShare.getLabelCell().getPrefWidth() + 30);
    }else{
        TextButton textButtonOk = new TextButton(bundle.get("ok"), txtButtonStyle);
        setObject(textButtonOk, 1);
        getButtonTable().add(textButtonOk);

    }
}
 
开发者ID:MartensCedric,项目名称:Hexpert,代码行数:48,代码来源:LevelCompleteDialog.java


注:本文中的com.badlogic.gdx.scenes.scene2d.ui.Skin.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。