本文整理匯總了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);
}
}