本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.Label.setSize方法的典型用法代码示例。如果您正苦于以下问题:Java Label.setSize方法的具体用法?Java Label.setSize怎么用?Java Label.setSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.ui.Label
的用法示例。
在下文中一共展示了Label.setSize方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUpMoneyLabel
import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
public void setUpMoneyLabel() {
moneyImage = new Image(AssetsManager.getTextureRegion(Constants.COIN_NAME));
moneyImage.setSize(2.5f, 2.5f);
moneyImage.setPosition(Constants.WIDTH * 2 / 3 + 0.5f, onFinish.getY() + onFinish.getHeight() * 1.3f + moneyImage.getHeight() / 5.5f);
moneyImage.setOrigin(moneyImage.getWidth() / 2, moneyImage.getHeight() / 2);
moneyImage.setVisible(false);
stage.addActor(moneyImage);
Label.LabelStyle labelStyle = new Label.LabelStyle();
labelStyle.font = AssetsManager.getMediumFont();
moneyLabel = new Label(" " + 0, labelStyle);
moneyLabel.setFontScale(0.065f);
moneyLabel.setSize(moneyLabel.getWidth() * moneyLabel.getFontScaleX(), moneyLabel.getHeight() * moneyLabel.getFontScaleY());
moneyLabel.setPosition(moneyImage.getX() - moneyLabel.getWidth(), moneyImage.getY());
moneyLabel.setVisible(false);
stage.addActor(moneyLabel);
}
示例2: 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);
}
示例3: 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);
}
示例4: setUpSkinNameLabel
import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
public void setUpSkinNameLabel() {
Label.LabelStyle labelStyle = new Label.LabelStyle();
labelStyle.font = AssetsManager.getLargeFont();
skinLabel = new Label(skins.get(position).getLabel(), labelStyle);
skinLabel.setFontScale(0.065f);
skinLabel.setSize(Constants.WIDTH, Constants.LARGE_FONT_SIZE * skinLabel.getFontScaleY() + 1);
skinLabel.setAlignment(Align.center);
skinLabel.setPosition(0, Constants.HEIGHT * 2 / 3);
stage.addActor(skinLabel);
}
示例5: 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);
}
示例6: 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);
}
示例7: setUpDesignerLabel
import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
public void setUpDesignerLabel() {
Label.LabelStyle labelStyle = new Label.LabelStyle();
labelStyle.font = AssetsManager.getLargeFont();
designerLabel = new Label("Designer", labelStyle);
designerLabel.setFontScale(0.065f);
designerLabel.setSize(Constants.WIDTH, Constants.LARGE_FONT_SIZE * designerLabel.getFontScaleY() + 1);
designerLabel.setAlignment(Align.center);
designerLabel.setPosition(0, whoDeveloperLabel.getY() - designerLabel.getHeight() * 2 / 3);
stage.addActor(designerLabel);
}
示例8: 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);
}
示例9: 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);
}
示例10: 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);
}
示例11: 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);
}
示例12: setUpBonusLabel
import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
public void setUpBonusLabel() {
Label.LabelStyle labelStyle = new Label.LabelStyle();
labelStyle.font = AssetsManager.getMediumFont();
bonusLabel = new Label("extra life", labelStyle);
bonusLabel.setFontScale(0.065f);
bonusLabel.setSize(bonusLabel.getWidth() * bonusLabel.getFontScaleX(), bonusLabel.getHeight() * bonusLabel.getFontScaleY());
bonusLabel.setPosition(Constants.WIDTH / 4 - bonusLabel.getWidth() * 2 / 5, Constants.HEIGHT / 2 - Constants.RECTANGLE_BUTTON_HEIGHT * 1.5f * 1.65f + 0.4f);
bonusLabel.setAlignment(Align.center);
bonusLabel.setVisible(false);
stage.addActor(bonusLabel);
}
示例13: drawoneDefenders
import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
private Group drawoneDefenders(String typeFrame,String name,Color type,String photo,float energy,float energymax){
Group gr = new Group();
Texture txt = managerAssets.getAssetsCombat().getTexture(typeFrame);
Vector2 crop = Scaling.fit.apply(txt.getWidth(), txt.getHeight(), WIDTH, HEIGHT);
Image frame = new Image(new TextureRegion(txt));
frame.setName("frame");
frame.setSize(crop.x * 0.18f, crop.y * 0.2f);
frame.setPosition(WIDTH * 0.025f, HEIGHT / 2.3f);
gr.addActor(frame);
if(InformationProfile.getInstance().getDateUserGame().getFaction() == InformationEnklave.getInstance().getFaction())
txt = managerAssets.getAssetsCombat().getTexture(NameFiles.targetRecharge);
else
txt = managerAssets.getAssetsCombat().getTexture(NameFiles.target);
crop = Scaling.fit.apply(txt.getWidth(), txt.getHeight(), WIDTH, HEIGHT);
Image frameselect = new Image(new TextureRegion(txt));
frameselect.setName("frameselect");
frameselect.toFront();
frameselect.setSize(crop.x * 0.18f, crop.y * 0.2f);
frameselect.setPosition(WIDTH * 0.025f, HEIGHT / 2.3f);
frameselect.setVisible(false);
gr.addActor(frameselect);
Label labelName = new Label(name.substring(0,name.length()>9 ? 9 : name.length()),new Label.LabelStyle(bt,type));
labelName.setAlignment(Align.center);
labelName.setSize(WIDTH * 0.18f, HEIGHT * 0.02f);
labelName.setPosition(frame.getX(), frame.getY() + frame.getHeight() * 0.25f);
gr.addActor(labelName);
txt = managerAssets.getAssetsCombat().getTexture(photo);
crop = Scaling.fit.apply(txt.getWidth(), txt.getHeight(), WIDTH, HEIGHT);
Image profile = new Image(new TextureRegion(txt));
// profile.setColor(Color.BLUE);
profile.setSize(crop.x*0.07f, crop.y*0.07f);
profile.setPosition(frame.getRight() - frame.getWidth() / 2 - profile.getWidth() / 2, frame.getY() + frame.getHeight() * 0.42f);
gr.addActor(profile);
Skin skin = new Skin();
skin.add("white", new TextureRegion(managerAssets.getAssetsCombat().getTexture(NameFiles.barLifeWhite),0,0,(int)(WIDTH*0.004),(int)(WIDTH*0.014)));
ProgressBar.ProgressBarStyle barStyle = new ProgressBar.ProgressBarStyle(skin.newDrawable("white", Color.WHITE), skin.newDrawable("white",type));
barStyle.knobBefore = barStyle.knob;
ProgressBar bar = new ProgressBar(0, energymax, 1, false, barStyle);
bar.setSize(WIDTH * 0.14f, HEIGHT * 0.012f);
bar.setPosition(frame.getX()+frame.getWidth()*0.1f, frame.getY()+frame.getHeight()*0.07f);
bar.setValue(energy);
gr.addActor(bar);
return gr;
}