本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.TextButton.setStyle方法的典型用法代码示例。如果您正苦于以下问题:Java TextButton.setStyle方法的具体用法?Java TextButton.setStyle怎么用?Java TextButton.setStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.ui.TextButton
的用法示例。
在下文中一共展示了TextButton.setStyle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: show
import com.badlogic.gdx.scenes.scene2d.ui.TextButton; //导入方法依赖的package包/类
@Override
public void show() {
batch = new SpriteBatch();
viewport = new FitViewport(Constants.DIFFICULTY_WORLD_SIZE_WIDTH, Constants.DIFFICULTY_WORLD_SIZE_HEIGHT);
renderer = new ShapeRenderer();
renderer.setAutoShapeType(true);
stage = new Stage(viewport);
Gdx.input.setInputProcessor(stage);
Skin uiSkin = new Skin(Gdx.files.internal("UiSkin/uiskin.json"));
button = new TextButton(menucontinue, uiSkin);
TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
textButtonStyle.font = font12;
textButtonStyle.up = uiSkin.newDrawable("white", Color.DARK_GRAY);
textButtonStyle.down = uiSkin.newDrawable("white", Color.DARK_GRAY);
textButtonStyle.checked = uiSkin.newDrawable("white", Color.DARK_GRAY);
textButtonStyle.over = uiSkin.newDrawable("white", Color.DARK_GRAY);
button.setStyle(textButtonStyle);
imageLogo = new Image();
imageLogo.setDrawable(new TextureRegionDrawable(new TextureRegion(new Texture(Gdx.files.internal("Star.png")))));
/*container=new Container<Image>(imageLogo);
container.setTransform(true); // for enabling scaling and rotation
container.size(100, 100);
container.setOrigin(Align.center);//container.getWidth() / 2, container.getHeight() / 2);
container.setPosition(100,100);
container.setScale(1); //scale according to your requirement
*/
Table table = new Table();
table.setFillParent(true);
table.add(imageLogo);
table.row();
table.add(button).width(450).height(300).pad(10);
table.row();
stage.addActor(table);
//container.addAction(Actions.parallel(/*Actions.moveTo(500, 300, 2.0f),*/Actions.rotate(1.f,1.0f)));//Actions.scaleTo(0.1f, 0.1f,2.0f)));
button.addListener(new ChangeListener() {
public void changed (ChangeEvent event, Actor actor) {
if(!victory || (victory && level == maxNumLevels))
game.ShowMenuScreen();
else
game.ShowSuperBullScreen(level +1);
}
});
}