本文整理匯總了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);
}
});
}