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


Java Label.LabelStyle方法代码示例

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


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

示例1: ShareScoreScreen

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
ShareScoreScreen(final Klooni game, final Screen lastScreen,
                 final int score, final boolean timeMode) {
    this.game = game;
    this.lastScreen = lastScreen;

    this.score = score;
    this.timeMode = timeMode;

    final Label.LabelStyle labelStyle = new Label.LabelStyle();
    labelStyle.font = game.skin.getFont("font_small");

    infoLabel = new Label("Generating image...", labelStyle);
    infoLabel.setColor(Klooni.theme.textColor);
    infoLabel.setAlignment(Align.center);
    infoLabel.layout();
    infoLabel.setPosition(
            (Gdx.graphics.getWidth() - infoLabel.getWidth()) * 0.5f,
            (Gdx.graphics.getHeight() - infoLabel.getHeight()) * 0.5f);

    spriteBatch = new SpriteBatch();
}
 
开发者ID:LonamiWebs,项目名称:Klooni1010,代码行数:22,代码来源:ShareScoreScreen.java

示例2: UpdateInvisibleCells

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
public void UpdateInvisibleCells()
{
    for(int i =0; i< labelArrayList.size();i++){
        Label label = labelArrayList.get(i);
        if(!label.isVisible()){
            Random random = new Random();
            int rand = random.nextInt(5);
            CalculateColorText calculateColorText = new CalculateColorText(rand).invoke();
            Color color = calculateColorText.getColor();
            String text = calculateColorText.getText();
            Label.LabelStyle labelStyle = new Label.LabelStyle();
            labelStyle.font = font50;
            labelStyle.background = uiSkin.newDrawable("white", color);
            label.setText(text);
            label.setStyle(labelStyle);
            label.setVisible(true);
        }
    }
}
 
开发者ID:luarca84,项目名称:Caramelos,代码行数:20,代码来源:CaramelosScreen.java

示例3: StageLoad

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
/**
 * Loading stage
 * @param doLoad should resources be loaded? It acts as a splash screen otherwise.
 */
public StageLoad(boolean doLoad) {
	this.doLoad = doLoad;
	// Create icon
	icon = new Image(new Texture("image/icon-512.png"));
	int size = Gdx.graphics.getHeight();
	if (Gdx.graphics.getHeight() > Gdx.graphics.getWidth())
		size = Gdx.graphics.getWidth();
	icon.setSize(size, size);
	icon.setPosition(Gdx.graphics.getWidth() / 2 - size / 2,
			Gdx.graphics.getHeight() / 2 - icon.getHeight() / 2);
	addActor(icon);
	// Loading Text
	Label.LabelStyle loadingStyle = new Label.LabelStyle();
	loadingStyle.font = new BitmapFont(Gdx.files.internal("font/collvetica.fnt"));
	loadingStyle.font.getData().setScale(Gdx.graphics.getHeight() * 2 / 720);
	loading = new Label("DRC Sim", loadingStyle);
	loading.setBounds(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight() * .2f);
	loading.setAlignment(Align.center);
	addActor(loading);
}
 
开发者ID:rolandoislas,项目名称:drc-sim-client,代码行数:25,代码来源:StageLoad.java

示例4: HudScene

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
public HudScene(SpriteBatch batch, ShapeRenderer shapeRenderer, ArcRenderer arcRenderer) {
    this.batch = batch;
    stage = new Stage();

    VisUI.load();

    Table table = new Table();
    table.top();
    table.setFillParent(true);

    scoreLabel = new Label("", new Label.LabelStyle(new BitmapFont(), Color.VIOLET));
    setScore(score);
    balanceLabel = new Label("", new Label.LabelStyle(new BitmapFont(), Color.VIOLET));
    setBalance(balance);

    table.add(scoreLabel).align(Align.left).expandX();
    table.add(balanceLabel).align(Align.right).expandX();

    stage.addActor(table);


    ringButton = new RingButton(shapeRenderer, arcRenderer);
    ringButton.setBounds(10, 10, 100, 100);
    stage.addActor(ringButton);
}
 
开发者ID:MiniDigger,项目名称:projecttd,代码行数:26,代码来源:HudScene.java

示例5: addChangeFaction

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
private void addChangeFaction(){
    groupChangeFaction = new Group();
    Image background = new Image(new TextureRegion(manager.getAssetsSettings().getTexture(NameFiles.extensionImgBackground)));
    background.setSize(Width - Width * 0.03f, Height * 0.1f);
    background.setPosition(Width / 2 - background.getWidth() / 2, Height * 0.3f);
    groupChangeFaction.addActor(background);
    Label labelFac = new Label("Change Faction",new Label.LabelStyle(Font.getFont((int)(Height*0.025f)),Color.WHITE));
    labelFac.setPosition(background.getX()+background.getWidth()*0.05f,background.getY()+background.getHeight()/2-labelFac.getHeight()/2);
    labelFac.addListener(new ClickListener(){
        @Override
        public void clicked(InputEvent event, float x, float y) {
            manager.loadAssetsChoiceFaction();
            gameManager.setScreen(new ScreenCircleLoading(gameManager,new ScreenChoiceFaction(gameManager),manager.getAssetsChoiceFaction()));
        }
    });
    groupChangeFaction.addActor(labelFac);
}
 
开发者ID:TudorRosca,项目名称:enklave,代码行数:18,代码来源:ScreenSetting.java

示例6: createDefaultLabelStyle

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
private Label.LabelStyle createDefaultLabelStyle() {

        currentBackground = cache.getPixMapTexture(DEFAULT_BACKGROUND_COLOR);
        Label.LabelStyle labelStyle = new Label.LabelStyle(font, font.getColor());
        labelStyle.background = new Image(currentBackground).getDrawable();

        return labelStyle;
    }
 
开发者ID:cpppwner,项目名称:NoRiskNoFun,代码行数:9,代码来源:AssetLabelImpl.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: PlayState

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
public PlayState(GameStateManager gsm) {
        super(gsm);
        score = 0;
        chapa = new Chapa(50, 300);
        camera.setToOrtho(false, FlappyChapa.WIDTH / 2, FlappyChapa.HEIGHT / 2);
        Texture texture = new Texture("bg.png");
        backGround = new org.academiadecodigo.bootcamp.sprites.Background(camera);
        backGround.start();
        ground = new Texture("ground.png");
        /*table = new Table();
        table.setPosition(camera.position.x,camera.position.y);
        //table.setBounds(camera.position.x,camera.position.y,camera.viewportWidth,camera.viewportHeight/10);
        table.setFillParent(true);*/
        scoreLabel = new Label(String.format("%06d", score), new Label.LabelStyle(new BitmapFont(), Color.WHITE));
        scoreLabel.setPosition(camera.position.x,0);
        startTime = TimeUtils.nanoTime();
        anto = new Anto(camera);
//        groundPos1 = new Vector2(camera.position.x - camera.viewportWidth / 2, GROUND_Y_OFFSET);
//        groundPos2 = new Vector2((camera.position.x - camera.viewportWidth / 2) + ground.getWidth(), GROUND_Y_OFFSET);
        tubes = new Array<Tube>();
        for (int i = 0; i < TUBE_COUNT; i++) {
            tubes.add(new Tube(i * (TUBE_SPACING + Tube.TUBE_WIDTH)));
        }

        music = Gdx.audio.newMusic(Gdx.files.internal("bigSmoke_justAudio.mp3"));
        music.setLooping(true);
        music.setVolume(0.5f);
        music.play();
    }
 
开发者ID:RubenMateus,项目名称:FlappyChapa,代码行数:30,代码来源:PlayState.java

示例9: 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

示例10: SplashMenu

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
public SplashMenu() {
  logo = new Image(new TextureRegionDrawable(Assets.getTextureRegion("core:logo.png")), Scaling.fillY, Align.center);
  text = new Label("Loading " + Branding.DEBUG, new Label.LabelStyle(Fonts.smallHUD, Color.WHITE));

  stage.addActor(logo);
  stage.addActor(text);
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:8,代码来源:SplashMenu.java

示例11: 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

示例12: 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

示例13: 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

示例14: BaseScorer

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
BaseScorer(final Klooni game, GameLayout layout, int highScore) {
    cupTexture = SkinLoader.loadPng("cup.png");
    cupColor = Klooni.theme.currentScore.cpy();
    cupArea = new Rectangle();

    Label.LabelStyle labelStyle = new Label.LabelStyle();
    labelStyle.font = game.skin.getFont("font");

    currentScoreLabel = new Label("0", labelStyle);
    currentScoreLabel.setAlignment(Align.right);

    highScoreLabel = new Label(Integer.toString(highScore), labelStyle);

    layout.update(this);
}
 
开发者ID:LonamiWebs,项目名称:Klooni1010,代码行数:16,代码来源:BaseScorer.java

示例15: Hud

import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
public Hud(SpriteBatch sb) {

        score = 0;

        viewport = new FitViewport(FlappyChapa.WIDTH/2, FlappyChapa.HEIGHT/2, new OrthographicCamera());
        stage = new Stage(viewport,sb);

        Table table = new Table();
        table.top();
        table.setFillParent(true);

        scoreLabel = new Label(String.format("%06d", score), new Label.LabelStyle(new BitmapFont(), Color.WHITE));
        scoreTextLabel = new Label("SCORE", new Label.LabelStyle(new BitmapFont(), Color.WHITE));

        table.add(scoreTextLabel);
        table.add(scoreLabel);

        stage.addActor(table);    }
 
开发者ID:RubenMateus,项目名称:FlappyChapa,代码行数:19,代码来源:Hud.java


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