本文整理汇总了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();
}
}
示例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);
}
示例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));
}
示例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);
}
示例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);
}
}