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


Java I18NBundle.get方法代码示例

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


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

示例1: ActionDialog

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

示例2: TutorialDialog

import com.badlogic.gdx.utils.I18NBundle; //导入方法依赖的package包/类
public TutorialDialog(Hexpert hexpert, Skin skin, boolean useScrollPane) {
    super(hexpert, skin);
    scrollContent = new Table();
    if(useScrollPane) {
        scrollPane = new ScrollPane(scrollContent, skin);
        getContentTable().add(scrollPane);
    }

    getButtonTable().defaults().pad(15);
    I18NBundle i18N = hexpert.i18NBundle;

    TextButton textButtonOk = new TextButton(i18N.get("ok"), skin);
    getButtonTable().add(textButtonOk);

    setObject(textButtonOk, null);
}
 
开发者ID:MartensCedric,项目名称:Hexpert,代码行数:17,代码来源:TutorialDialog.java

示例3: LoadingStage

import com.badlogic.gdx.utils.I18NBundle; //导入方法依赖的package包/类
public LoadingStage() {
        GDefence.getInstance().assetLoader.load("MainMenuBg.png", Texture.class);//TODO
        GDefence.getInstance().assetLoader.load("mobHpBarBg.png", Texture.class);
        GDefence.getInstance().assetLoader.load("mobHpBarKnob.png", Texture.class);
//        I18NBundleLoader.I18NBundleParameter param = new I18NBundleLoader.I18NBundleParameter(/*new Locale("ru")*/Locale.US, "UTF-8");//TODO move to another place
//        GDefence.getInstance().assetLoader.load("Language/text", I18NBundle.class, param);
//        GDefence.getInstance().assetLoader.finishLoading();
        GDefence.getInstance().assetLoader.initLang("en");


        Image bg = new Image(GDefence.getInstance().assetLoader.get("MainMenuBg.png", Texture.class));
        addActor(bg);
        loadBar = new ProgressBar(0, 100, 1, false, GDefence.getInstance().assetLoader.getMobHpBarStyle());
        loadBar.setSize(300, 50);
        loadBar.getStyle().background.setMinHeight(loadBar.getHeight());
        loadBar.getStyle().knob.setMinHeight(loadBar.getHeight());
        loadBar.setPosition(Gdx.graphics.getWidth()/2 - loadBar.getWidth()/2, Gdx.graphics.getHeight()/2 - loadBar.getHeight()/2);
        addActor(loadBar);
        I18NBundle b = GDefence.getInstance().assetLoader.get("Language/text", I18NBundle.class);
        Label loading = new Label(b.get("loading"), FontLoader.generateStyle(34, Color.BLACK));//
        loading.setPosition(loadBar.getX() + loadBar.getWidth()/2 - loading.getWidth()/2,
                            loadBar.getY() - loadBar.getHeight());
        addActor(loading);
    }
 
开发者ID:mrDarkHouse,项目名称:GDefence,代码行数:25,代码来源:LoadingStage.java

示例4: StatusScreen

import com.badlogic.gdx.utils.I18NBundle; //导入方法依赖的package包/类
public StatusScreen(CaramelosGame game, boolean victory,int level)
{
    this.game = game;
    this.victory = victory;
    this.level = level;

    Preferences prefs = Gdx.app.getPreferences("My Preferences");
    flagSound = prefs.getBoolean("sound");
    if(victory)
        mp3Music = Gdx.audio.newMusic(Gdx.files.internal("Music/Victory.mp3"));
    else{
        mp3Music = Gdx.audio.newMusic(Gdx.files.internal("Music/GameOver.mp3"));
    }
    mp3Music.setLooping(true);
    if(flagSound){
        mp3Music.play();
    }

    FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("Vollkorn/Vollkorn-Regular.ttf"));
    FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter();
    parameter.size = 24;
    font12 = generator.generateFont(parameter); // font size 12 pixels
    generator.dispose(); // don't forget to dispose to avoid memory leaks!

    FileHandle baseFileHandle = Gdx.files.internal("Messages/menus");
    String localeLanguage =java.util.Locale.getDefault().toString();
    Locale locale = new Locale(localeLanguage);
    I18NBundle myBundle = I18NBundle.createBundle(baseFileHandle, locale,"UTF-8");
    menulevel = myBundle.get("menulevel");
    menuvictory = myBundle.get("menuvictory");
    menuchampion = myBundle.get("menuchampion");
    menucontinue = myBundle.get("menucontinue");
    menugameover = myBundle.get("menugameover");
}
 
开发者ID:luarca84,项目名称:Caramelos,代码行数:35,代码来源:StatusScreen.java

示例5: FreeridingDialog

import com.badlogic.gdx.utils.I18NBundle; //导入方法依赖的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

示例6: LockedTutDialog

import com.badlogic.gdx.utils.I18NBundle; //导入方法依赖的package包/类
public LockedTutDialog(Hexpert hexpert, Skin skin) {
    super(hexpert, skin, false);
    I18NBundle i18n = hexpert.i18NBundle;
    Label lblContent = new Label(i18n.get("lck_diag"), skin);
    lblContent.setAlignment(Align.center);
    lblContent.setWrap(true);
    getContentTable().defaults().pad(25);
    getContentTable().add(lblContent).width(800);
}
 
开发者ID:MartensCedric,项目名称:Hexpert,代码行数:10,代码来源:LockedTutDialog.java

示例7: AbstractCampainScreen

import com.badlogic.gdx.utils.I18NBundle; //导入方法依赖的package包/类
public AbstractCampainScreen(String name) {
        super();
        setBackground(GDefence.getInstance().assetLoader.get("CampainBg.png", Texture.class));
        I18NBundle b = GDefence.getInstance().assetLoader.get("Language/text", I18NBundle.class);
        this.name = b.get(name);
        batch = new SpriteBatch();
        //stage = new Stage();
        //shape = new ShapeRenderer();

//        Gdx.input.setInputProcessor(stage);
        define();
    }
 
开发者ID:mrDarkHouse,项目名称:GDefence,代码行数:13,代码来源:AbstractCampainScreen.java

示例8: init

import com.badlogic.gdx.utils.I18NBundle; //导入方法依赖的package包/类
private void init(){
        I18NBundle b = GDefence.getInstance().assetLoader.get("Language/text", I18NBundle.class);
        getTitleLabel().setText(b.get("level") + " " + levelButton.getNumber());
        getTitleLabel().setAlignment(Align.center);
        clear();
        MapLoader ml = new MapLoader(levelButton.getNumber());
        ml.loadMap();
        ml.loadProperties(ml.getSpawnersNumber(), false);
        User u = GDefence.getInstance().user;

        waves = b.get("waves") + ": " + ml.getNumberWaves();
        exp = b.get("exp") + " : ";// + ml.getExpFromLvl();
        expValue = u.getLevelCompleted(levelButton.getNumber()) ?  ml.getExpFromLvl()/4: ml.getExpFromLvl();
        gold = b.get("gold") + ": ";// + ml.getGoldFromLvl();
        goldValue = u.getLevelCompleted(levelButton.getNumber()) ?  ml.getGoldFromLvl()/4: ml.getGoldFromLvl();
        hp = b.get("sHealth") + ": " + (int)(ml.getStartHpPercent() * 100) + "%";
        en = b.get("sEnergy") + ": " + (int)(ml.getStartEnergyPercent() * 100) + "%";

//        drop1 = "";
//        drop2 = "";
        drop1 = getDropTooltip(ml.getDropList());
        drop2 = getDropTooltip(ml.getPenaltyDropList());
//        drop += GDefence.getInstance().user.getLevelCompleted(levelButton.getNumber()) ? getDropTooltip(ml.getPenaltyDropList()) : getDropTooltip(ml.getDropList());



//        String drop = GDefence.getInstance().user.getLevelCompleted(levelButton.getNumber()) ? drop2 : drop1;

        label = new Label(""/*waves + System.getProperty("line.separator") +
                exp + System.getProperty("line.separator") +
                gold + System.getProperty("line.separator") +
                hp + System.getProperty("line.separator") +
                en +
                drop*/, skin, "description");
        hasChanged();
        add(label);
//        pack();
    }
 
开发者ID:mrDarkHouse,项目名称:GDefence,代码行数:39,代码来源:LevelTooltip.java

示例9: show

import com.badlogic.gdx.utils.I18NBundle; //导入方法依赖的package包/类
@Override
public void show() {
    batch = new SpriteBatch();
    Skin uiSkin = new Skin(Gdx.files.internal("UiSkin/uiskin.json"));

    Preferences prefs = Gdx.app.getPreferences("MyPreferences");
    flagSound = prefs.getBoolean("sound");
    mp3Music = Gdx.audio.newMusic(Gdx.files.internal("Music/Intro.mp3"));
    mp3Music.setLooping(true);
    if(flagSound){
        mp3Music.play();
    }

    viewport = new FitViewport(Constants.DIFFICULTY_WORLD_SIZE_WIDTH, Constants.DIFFICULTY_WORLD_SIZE_HEIGHT);
    renderer = new ShapeRenderer();
    renderer.setAutoShapeType(true);

    Gdx.input.setInputProcessor(this);

    FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("Vollkorn/Vollkorn-Regular.ttf"));
    FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter();
    parameter.size = 24;
    BitmapFont font12 = generator.generateFont(parameter); // font size 12 pixels
    generator.dispose(); // don't forget to dispose to avoid memory leaks!

    FileHandle baseFileHandle = Gdx.files.internal("Messages/menus");
    String localeLanguage =java.util.Locale.getDefault().toString();
    Locale locale = new Locale(localeLanguage);
    I18NBundle myBundle = I18NBundle.createBundle(baseFileHandle, locale,"UTF-8");
    String menuabout = myBundle.get("menuabout");
    String menudevelopers = myBundle.get("menudevelopers");

    stage = new Stage(viewport);
    Label label = new Label(menuabout,uiSkin);
    Label label2 = new Label("\n"+menudevelopers+":\nluarca84\n" +
            "laibach" ,uiSkin);
    label2.setAlignment(Align.center);
    Label.LabelStyle labelStyle = new Label.LabelStyle();
    labelStyle.font = font12;
    label2.setStyle(labelStyle);
    label.setStyle(labelStyle);

    Texture texture = new Texture("android_libgdx.png");
    TextureRegion textureRegion = new TextureRegion(texture);
    Image image = new Image(textureRegion);

    Table tableParent = new Table();
    tableParent.setFillParent(true);
    Table table = new Table();
    table.add(label);
    table.row();
    table.add(label2);
    table.row();

    tableParent.add(table);
    tableParent.row();
    tableParent.add(image).width(450);
    stage.addActor(tableParent);

}
 
开发者ID:luarca84,项目名称:Caramelos,代码行数:61,代码来源:AboutScreen.java

示例10: LevelCompleteDialog

import com.badlogic.gdx.utils.I18NBundle; //导入方法依赖的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.utils.I18NBundle.get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。