本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.Label.setPosition方法的典型用法代码示例。如果您正苦于以下问题:Java Label.setPosition方法的具体用法?Java Label.setPosition怎么用?Java Label.setPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.ui.Label
的用法示例。
在下文中一共展示了Label.setPosition方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: addTestCombat
import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
private void addTestCombat(){
groupTestCombat = 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.15f);
groupChangeFaction.addActor(background);
Label labelFac = new Label("Combat Training",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.loadAssetsEnklaveScreen();
new GetEnklaveDetails().makeRequest(16066, manager);
gameManager.screenEnklave.setEnklave3D(new Vector2(0,0));
gameManager.setScreen(new ScreenCircleLoading(gameManager,gameManager.screenEnklave,manager.getAssertEnklaveScreen()));;
}
});
groupChangeFaction.addActor(labelFac);
}
示例3: screenExit
import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
public void screenExit(String message){
messageShow = message;
showtextexit = true;
circleShow = false;
InformationProfile.getInstance().getDateUserGame().setEnklaveCombatId(-1);
Label labelmess = new Label("You already joined this combat once!",new Label.LabelStyle(bitmapFont,Color.WHITE));
labelmess.setPosition(WIDTH /2 - labelmess.getWidth() /2,labelmess.getHeight()*2);
stage.addActor(labelmess);
combatFight.deselect();
attachers.deselect();
defenders.deselect();
if(!message.contentEquals("You lose!")){
new Timer().scheduleTask(new Timer.Task() {
@Override
public void run() {
managerAssets.getAssertEnklaveScreen().setIsupdate(false);
new GetEnklaveDetails().makeRequest(InformationEnklave.getInstance().getId(), managerAssets);
// gameManager.setScreen(gameManager.screenEnklave);
}
},1);
}
}
示例4: onInitUI
import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
@Override
protected void onInitUI() {
Skin skin = GdxUISkin.instance().getDeafult();
label = new Label("", skin);
label.setOrigin(0, 0);
label.setPosition(10, 10);
addUI(label);
skin = null;
}
示例5: 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();
}
示例6: addtimerbuildroom
import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
private void addtimerbuildroom(){
grouptimerbuild = new Group();
Image bg = new Image(new TextureRegion(manager.getAssetsExtension().getTexture(NameFiles. extensionImgBackground)));
bg.setSize(Gdx.graphics.getWidth() / 2.75f, Gdx.graphics.getHeight() * 0.33f);
bg.setPosition(Gdx.graphics.getWidth() / 2 - bg.getWidth() / 2, Gdx.graphics.getHeight()*0.35f);
grouptimerbuild.addActor(bg);
Label labelBuildingRoom = new Label("Installing\nExtension",new Label.LabelStyle(Font.getFont((int)(Gdx.graphics.getHeight()*0.025)),Color.WHITE));
labelBuildingRoom.setPosition(Gdx.graphics.getWidth() / 2 - labelBuildingRoom.getWidth() / 2, Gdx.graphics.getHeight() / 1.65f);
grouptimerbuild.addActor(labelBuildingRoom);
labelprocent = new Label("0%",new Label.LabelStyle(new Label.LabelStyle(Font.getFont((int)(Gdx.graphics.getHeight()*0.03)),Color.WHITE)));
labelprocent.setPosition(Gdx.graphics.getWidth() / 2 - labelprocent.getWidth() / 2, Gdx.graphics.getHeight() / 2f - labelprocent.getHeight() / 2);
grouptimerbuild.addActor(labelprocent);
grouptimerbuild.setVisible(false);
}
示例7: addtimerbuildroom
import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
private void addtimerbuildroom(){
grouptimerbuild = new Group();
Image bg = new Image(new TextureRegion(manager.getAssetsRooms().getTexture(NameFiles.extensionImgBackground)));
bg.setSize(Gdx.graphics.getWidth() / 2.75f, Gdx.graphics.getHeight() *0.32f);
bg.setPosition(Gdx.graphics.getWidth() / 2 - bg.getWidth() / 2, Gdx.graphics.getHeight() / 5f);
grouptimerbuild.addActor(bg);
Label labelBuildingRoom = new Label("Building Room",new Label.LabelStyle(Font.getFont((int)(Gdx.graphics.getHeight()*0.025)), Color.WHITE));
labelBuildingRoom.setPosition(Gdx.graphics.getWidth() / 2 - labelBuildingRoom.getWidth() / 2, Gdx.graphics.getHeight() / 2.2f);
grouptimerbuild.addActor(labelBuildingRoom);
labelprocent = new Label("0%",new Label.LabelStyle(new Label.LabelStyle(Font.getFont((int)(Gdx.graphics.getHeight()*0.03)),Color.WHITE)));
labelprocent.setPosition(Gdx.graphics.getWidth() / 2 - labelprocent.getWidth() / 2, Gdx.graphics.getHeight() / 3.1f);
grouptimerbuild.addActor(labelprocent);
grouptimerbuild.setVisible(false);
}
示例8: 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);
}
示例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: createTitle
import com.badlogic.gdx.scenes.scene2d.ui.Label; //导入方法依赖的package包/类
private void createTitle() {
BitmapFont titleFont = generateFont(124, true);
titleFont.getData().markupEnabled = true;
Label title = new Label(String.format("[#%s]P[] o l y [#%s]m[] o r p [#%s]h[]",
ShapeColor.RED.color, ShapeColor.GREEN.color, ShapeColor.BLUE.color),
new LabelStyle(titleFont, Color.WHITE));
title.setPosition(Polymorph.WORLD_WIDTH/2 - title.getWidth()/2, 4*Polymorph.WORLD_HEIGHT/5.5f);
stage.addActor(title);
}
示例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: 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);
}
示例13: 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);
}
示例14: 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);
}
示例15: 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);
}