Java Label.setFontScale方法代码示例

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


Java Label.setFontScale方法代码示例

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

示例1: initHUD

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
/**
 * Function used to initialize all the elements of the HUD and add the respective Listeners.
 */
private void initHUD() {
    Table hudTable = new Table();
    hudTable.setFillParent(true);

    Button pauseButton = new Button(new TextureRegionDrawable(
            new TextureRegion(game.getAssetManager().get("pause.png", Texture.class))));

    scoreText = new Label("0:00", skin);
    scoreText.setFontScale(FONT_SCALE, FONT_SCALE);

    pauseButton.addListener(new ClickListener() {
        @Override
        public void clicked(InputEvent event, float x, float y) {
            model.togglePause();
        }
    });

    hudTable.top();
    hudTable.add(scoreText).size(HUD_ELEMENTS_SIZE, HUD_ELEMENTS_SIZE).expandX()
            .left().fill().padLeft(HORIZONTAL_PAD).padTop(VERTICAL_PAD);
    hudTable.add(pauseButton).size(HUD_ELEMENTS_SIZE, HUD_ELEMENTS_SIZE).fill()
            .padRight(HORIZONTAL_PAD).padTop(VERTICAL_PAD);

    this.addActor(hudTable);
} 
开发者ID:AndreFCruz,项目名称:feup-lpoo-armadillo,代码行数:29,代码来源:HudMenu.java

示例2: MessageWindow

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
public MessageWindow(String message, BitmapFont font, float width, float height) {
    setTouchable(Touchable.enabled);
    setBounds(width / 2 - width / 4, height / 2 - height / 10, width / 2, height / 5);
    texture = new Texture("theme/basic/ui/Window.png");
    this.message = message;
    table = new Table();
    table.setSize(getWidth(), getHeight());
    table.align(Align.center | Align.top);
    table.setPosition(getX(), getY());
    Label label = new Label(message, new Label.LabelStyle(font, Color.BLACK));
    label.setWrap(true);
    label.setFontScale(0.7f);
    Label label2 = new Label("Tap to continue", new Label.LabelStyle(font, Color.BLACK));
    label2.setFontScale(0.6f);
    table.add(label).width(getWidth());
    table.row();
    table.add(label2).width(getWidth()).expandY();
    table.pad(0, 30, 0, 30);
} 
开发者ID:justinmarentette11,项目名称:Tower-Defense-Galaxy,代码行数:20,代码来源:MessageWindow.java

示例3: initStage

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
/**
 * Function used by all the Pop Up Menus for starting the initial procedures of the stage configuration.
 */
protected void initStage() {
    table.setFillParent(true);

    table.add(message).padBottom(LABEL_DISTANCE).row();
    message.setFontScale(MESSAGE_FONT_SCALE, MESSAGE_FONT_SCALE);

    Label score = new Label(hud.getScoreString(), skin);
    table.add(score).padBottom(LABEL_DISTANCE).row();
    score.setFontScale(SCORE_FONT_SCALE, SCORE_FONT_SCALE);
} 
开发者ID:AndreFCruz,项目名称:feup-lpoo-armadillo,代码行数:14,代码来源:OptionsMenu.java

示例4: setUpPriceLabel

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
public void setUpPriceLabel() {
    imageCoinPrice = new Image(AssetsManager.getTextureRegion(Constants.COIN_NAME));
    imageCoinPrice.setSize(2.5f, 2.5f);
    imageCoinPrice.setPosition(Constants.WIDTH / 3, skinImage.getY() - imageCoinPrice.getHeight() * 1.25f - 2f);
    stage.addActor(imageCoinPrice);

    Label.LabelStyle labelStyle = new Label.LabelStyle();
    labelStyle.font = AssetsManager.getMediumFont();
    priceLabel = new Label("000", labelStyle);
    priceLabel.setFontScale(0.065f);
    priceLabel.setSize(priceLabel.getWidth() * priceLabel.getFontScaleX(), priceLabel.getHeight() * priceLabel.getFontScaleY());
    priceLabel.setPosition(imageCoinPrice.getX() - priceLabel.getWidth(), skinImage.getY() - imageCoinPrice.getHeight() * 1.25f - 2f);
    stage.addActor(priceLabel);
} 
开发者ID:ZephyrVentum,项目名称:FlappySpinner,代码行数:15,代码来源:MarketScreen.java

示例5: setUpMoneyLabel

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
public void setUpMoneyLabel() {
    Image imageCoin = new Image(AssetsManager.getTextureRegion(Constants.COIN_NAME));
    imageCoin.setSize(2.5f, 2.5f);
    imageCoin.setPosition(Constants.WIDTH - imageCoin.getWidth() - 1f, Constants.HEIGHT - imageCoin.getHeight() - 1f);
    stage.addActor(imageCoin);

    Label.LabelStyle labelStyle = new Label.LabelStyle();
    labelStyle.font = AssetsManager.getMediumFont();
    moneyLabel = new Label("" + preferences.getUserMoney(), labelStyle);
    moneyLabel.setFontScale(0.065f);
    moneyLabel.setSize(moneyLabel.getWidth() * moneyLabel.getFontScaleX(), moneyLabel.getHeight() * moneyLabel.getFontScaleY());
    moneyLabel.setPosition(imageCoin.getX() - moneyLabel.getWidth(), imageCoin.getY());
    stage.addActor(moneyLabel);
} 
开发者ID:ZephyrVentum,项目名称:FlappySpinner,代码行数:15,代码来源:MarketScreen.java

示例6: initGuiInGame

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
private void initGuiInGame() {
    mGuiStage = new Stage(new ScreenViewport());

    Table gameScore = new Table();
    if (DEBUG_RENDERER) {
        gameScore.debug();
    }

    float scorePanelWidth = Gdx.graphics.getWidth() * 0.8f; // 80 % of screen
    float scorePanelHeight = Gdx.graphics.getHeight() * 0.2f; // 20 % of screen

    gameScore.setWidth(scorePanelWidth);
    gameScore.setHeight(scorePanelHeight);
    gameScore.setY(Gdx.graphics.getHeight() - (scorePanelHeight + 30.f));
    gameScore.setX((Gdx.graphics.getWidth() - scorePanelWidth) * 0.5f);

    gameScore.setBackground(new NinePatchDrawable(
            new NinePatch(new Texture(Gdx.files.internal("red_button13.png")), 24, 24, 24, 24)));
    gameScore.pad(32.f);

    Label scoreLabel = new Label("Score", new Label.LabelStyle(
            mDefaultFont, COLOR_FONT));
    scoreLabel.setFontScale(1.2f);

    gameScore.add(scoreLabel).expand();

    gameScore.row();

    mScoreLabel = new Label("" + mPointTotal, new Label.LabelStyle(
            mDefaultFont, COLOR_FONT));
    mScoreLabel.setFontScale(2.0f);

    gameScore.add(mScoreLabel).expand();

    mGuiStage.addActor(gameScore);
} 
开发者ID:tgobbens,项目名称:fluffybalance,代码行数:37,代码来源:Balanceball.java

示例7: setUpDeveloperLabel

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
public void setUpDeveloperLabel() {
    Label.LabelStyle labelStyle = new Label.LabelStyle();
    labelStyle.font = AssetsManager.getLargeFont();
    developerLabel = new Label("Developer", labelStyle);
    developerLabel.setFontScale(0.065f);
    developerLabel.setSize(Constants.WIDTH, Constants.LARGE_FONT_SIZE * developerLabel.getFontScaleY() + 1);
    developerLabel.setAlignment(Align.center);
    developerLabel.setPosition(0, Constants.HEIGHT - developerLabel.getHeight() - Constants.SQUARE_BUTTON_SIZE);
    stage.addActor(developerLabel);
} 
开发者ID:ZephyrVentum,项目名称:FlappySpinner,代码行数:11,代码来源:SettingsScreen.java

示例8: setUpWhoDeveloperLabel

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
public void setUpWhoDeveloperLabel() {
    Label.LabelStyle labelStyle = new Label.LabelStyle();
    labelStyle.font = AssetsManager.getMediumFont();
    whoDeveloperLabel = new Label("Alexander Klimenko", labelStyle);
    whoDeveloperLabel.setFontScale(0.065f);
    whoDeveloperLabel.setSize(Constants.WIDTH, Constants.LARGE_FONT_SIZE * whoDeveloperLabel.getFontScaleY() + 1);
    whoDeveloperLabel.setAlignment(Align.center);
    whoDeveloperLabel.setPosition(0, developerLabel.getY() - whoDeveloperLabel.getHeight() * 2 / 3);
    stage.addActor(whoDeveloperLabel);
} 
开发者ID:ZephyrVentum,项目名称:FlappySpinner,代码行数:11,代码来源:SettingsScreen.java

示例9: setUpWhoDesignerLabel

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
public void setUpWhoDesignerLabel() {
    Label.LabelStyle labelStyle = new Label.LabelStyle();
    labelStyle.font = AssetsManager.getMediumFont();
    whoDesignerLabel = new Label("Elena Kiselova", labelStyle);
    whoDesignerLabel.setFontScale(0.065f);
    whoDesignerLabel.setSize(Constants.WIDTH, Constants.LARGE_FONT_SIZE * whoDesignerLabel.getFontScaleY() + 1);
    whoDesignerLabel.setAlignment(Align.center);
    whoDesignerLabel.setPosition(0, designerLabel.getY() - whoDesignerLabel.getHeight() * 2 / 3);
    stage.addActor(whoDesignerLabel);
} 
开发者ID:ZephyrVentum,项目名称:FlappySpinner,代码行数:11,代码来源:SettingsScreen.java

示例10: setUpTesterLabel

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
public void setUpTesterLabel() {
    Label.LabelStyle labelStyle = new Label.LabelStyle();
    labelStyle.font = AssetsManager.getLargeFont();
    testerLabel = new Label("Tester", labelStyle);
    testerLabel.setFontScale(0.065f);
    testerLabel.setSize(Constants.WIDTH, Constants.LARGE_FONT_SIZE * testerLabel.getFontScaleY() + 1);
    testerLabel.setAlignment(Align.center);
    testerLabel.setPosition(0, whoDesignerLabel.getY() - testerLabel.getHeight() * 2 / 3);
    stage.addActor(testerLabel);
} 
开发者ID:ZephyrVentum,项目名称:FlappySpinner,代码行数:11,代码来源:SettingsScreen.java

示例11: setUpWhoTesterLabel

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
public void setUpWhoTesterLabel() {
    Label.LabelStyle labelStyle = new Label.LabelStyle();
    labelStyle.font = AssetsManager.getMediumFont();
    whoTester = new Label("Alexey Koshmanov", labelStyle);
    whoTester.setFontScale(0.065f);
    whoTester.setSize(Constants.WIDTH, Constants.LARGE_FONT_SIZE * whoTester.getFontScaleY() + 1);
    whoTester.setAlignment(Align.center);
    whoTester.setPosition(0, testerLabel.getY() - whoTester.getHeight() * 2 / 3);
    stage.addActor(whoTester);
} 
开发者ID:ZephyrVentum,项目名称:FlappySpinner,代码行数:11,代码来源:SettingsScreen.java

示例12: setUpScoreLabel

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
public void setUpScoreLabel() {
    Label.LabelStyle labelStyle = new Label.LabelStyle();
    labelStyle.font = AssetsManager.getMediumFont();
    scoreLabel = new Label("" + SCORE, labelStyle);
    scoreLabel.setFontScale(0.065f);
    scoreLabel.setSize(scoreLabel.getWidth() * scoreLabel.getFontScaleX(), scoreLabel.getHeight() * scoreLabel.getFontScaleY());
    scoreLabel.setPosition(Constants.WIDTH / 2 - scoreLabel.getWidth() / 2, Constants.HEIGHT * 4 / 5 - scoreLabel.getHeight() / 2);
    scoreLabel.setAlignment(Align.center);
    stage.addActor(scoreLabel);
} 
开发者ID:ZephyrVentum,项目名称:FlappySpinner,代码行数:11,代码来源:GameScreen.java

示例13: create

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
public void create() {
    Stage stage = new Stage(new ScreenViewport());
    getComponentByType(GuiComponent.class).stage = stage;

    Table gameScore = new Table();

    float scorePanelWidth = Gdx.graphics.getWidth() * 0.8f; // 80 % of screen
    float scorePanelHeight = Gdx.graphics.getHeight() * 0.2f; // 20 % of screen

    gameScore.setWidth(scorePanelWidth);
    gameScore.setHeight(scorePanelHeight);
    gameScore.setY(Gdx.graphics.getHeight() - (scorePanelHeight + 30.f));
    gameScore.setX((Gdx.graphics.getWidth() - scorePanelWidth) * 0.5f);

    gameScore.setBackground(new NinePatchDrawable(
            new NinePatch(new Texture(Gdx.files.internal("red_button13.png")), 24, 24, 24, 24)));
    gameScore.pad(32.f);

    Label scoreLabel = new Label("Score", new Label.LabelStyle(
            mFont, COLOR_FONT));
    scoreLabel.setFontScale(1.2f);

    gameScore.add(scoreLabel).expand();

    gameScore.row();

    mScoreLabel = new Label("" + 0, new Label.LabelStyle(mFont, COLOR_FONT));
    mScoreLabel.setFontScale(2.0f);

    gameScore.add(mScoreLabel).expand();

    stage.addActor(gameScore);
} 
开发者ID:tgobbens,项目名称:fluffybalance,代码行数:34,代码来源:IngameGuiEntity.java

示例14: addLeadBoardRow

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
private void addLeadBoardRow(String rank, String name, String score) {
    Label indexLabel = new Label(rank, mSkin);
    indexLabel.setFontScale(0.7f);
    indexLabel.setStyle(new Label.LabelStyle(mFont, COLOR_FONT));
    mScrollPaneTable.add(indexLabel)
            .expand(true, false)
            .center()
            .padTop(mDefaultMargin * 0.5f)
            .padBottom(mDefaultMargin * 0.5f)
            .padRight(mDefaultMargin * 0.5f);

    Label scoreNameLabel = new Label(name, mSkin);
    scoreNameLabel.setFontScale(0.7f);
    scoreNameLabel.setStyle(new Label.LabelStyle(mFont, COLOR_FONT));
    mScrollPaneTable.add(scoreNameLabel)
            .expand(true, false)
            .center()
            .padTop(mDefaultMargin * 0.5f)
            .padBottom(mDefaultMargin * 0.5f)
            .padRight(mDefaultMargin * 0.5f);

    Label scoreLabel = new Label(score, mSkin);
    scoreLabel.setFontScale(0.7f);
    scoreLabel.setStyle(new Label.LabelStyle(mFont, COLOR_FONT));
    mScrollPaneTable.add(scoreLabel)
            .expand(true, false)
            .center()
            .padTop(mDefaultMargin * 0.5f)
            .padBottom(mDefaultMargin * 0.5f);

    mScrollPaneTable.row();
} 
开发者ID:tgobbens,项目名称:fluffybalance,代码行数:33,代码来源:LeaderBoardGuiEntity.java

示例15: addTitle

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
private void addTitle() {
    mainTitle = new Label("  Retro \nReversi", game.getSkin());
    mainTitle.setFontScale(2);

    titleTable = new Table();
    titleTable.setFillParent(true);
    titleTable.top();
    titleTable.add(mainTitle).expandX().padTop(100);

    stage.addActor(titleTable);
} 
开发者ID:antonioalmeida,项目名称:retro-reversi,代码行数:12,代码来源:MainMenuView.java

本文标签属性:

示例:示例图

代码:代码大全可复制

java:javascript什么意思

Label:labels

setFontScale:setFontScale

上一篇:联合体的释义(联合体的范围是怎样的?)(联合体是什么?)
下一篇:Java OAuthConstants.PROFILE_URL属性代码示例

为您推荐