本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle类的典型用法代码示例。如果您正苦于以下问题:Java TextButtonStyle类的具体用法?Java TextButtonStyle怎么用?Java TextButtonStyle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TextButtonStyle类属于com.badlogic.gdx.scenes.scene2d.ui.TextButton包,在下文中一共展示了TextButtonStyle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: reviewTablePreview
import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle; //导入依赖的package包/类
private void reviewTablePreview() {
tablePreview.clear();
//tablePreview.debug();
tablePreview.center().left();
TextButtonStyle stylePreview = new TextButton.TextButtonStyle();
stylePreview.font = game.skin.getFont("default-font");
buttonPreview1 = new TextButton("1x Button", stylePreview);
buttonPreview1.setSize(imgWidth, imgHeight);
cellPreview1 = tablePreview.add(buttonPreview1).width(buttonPreview1.getWidth()).height(buttonPreview1.getHeight()).padBottom(15);
tablePreview.row();
buttonPreview2 = new TextButton("2x Button", stylePreview);
buttonPreview2.setSize(imgWidth * 2.0f, imgHeight * 2.0f);
cellPreview2 = tablePreview.add(buttonPreview2).width(buttonPreview2.getWidth()).height(buttonPreview2.getHeight()).padBottom(15);
tablePreview.row();
buttonPreview3 = new TextButton("3x Button", stylePreview);
buttonPreview3.setSize(imgWidth * 3.0f, imgHeight * 3.0f);
cellPreview3 = tablePreview.add(buttonPreview3).width(buttonPreview3.getWidth()).height(buttonPreview3.getHeight()).padBottom(15);
tablePreview.row();
}
示例2: makeRight
import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle; //导入依赖的package包/类
public static TextButton makeRight(){
TextButtonStyle style = new TextButtonStyle();
style.up = skinOne.getDrawable("right");
style.down = skinOne.getDrawable("rightpress");
style.over = skinOne.getDrawable("rightpress");
style.font = FontLoader.font(1f);
TextButton right = new TextButton("",style);
float w = Gdx.graphics.getWidth() / 14;
float h = Gdx.graphics.getHeight() / 12;
right.setWidth(w);
right.setHeight(h);
right.setPosition(w + w / 4 + h + w, h - h / 4 + w / 3 + h);
return right;
}
示例3: makeLeft
import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle; //导入依赖的package包/类
public static TextButton makeLeft(){
TextButtonStyle style = new TextButtonStyle();
style.up = skinOne.getDrawable("left");
style.down = skinOne.getDrawable("leftpress");
style.over = skinOne.getDrawable("leftpress");
style.font = FontLoader.font(1f);
TextButton left = new TextButton("",style);
float w = Gdx.graphics.getWidth() / 14;
float h = Gdx.graphics.getHeight() / 12;
left.setWidth(w);
left.setHeight(h);
left.setPosition(0, h - h / 4 + w / 3 + h);
return left;
}
示例4: makeDesc
import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle; //导入依赖的package包/类
public static TextButton makeDesc(){
TextButtonStyle style = new TextButtonStyle();
style.up = skinTwo.getDrawable("descend1");
style.down = skinTwo.getDrawable("descend2");
style.over = skinTwo.getDrawable("descend2");
style.font = FontLoader.font(1f);
TextButton dsc = new TextButton("",style);
float w = Gdx.graphics.getWidth() / 14;
float h = Gdx.graphics.getHeight() / 12;
dsc.setWidth(w);
dsc.setHeight(h);
dsc.setPosition(w / 2 + w/2 + h/10 + h/2, h - h / 4 + w / 3 + h);
return dsc;
}
示例5: rx
import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle; //导入依赖的package包/类
public static TextButton rx(){
TextButtonStyle style = new TextButtonStyle();
style.up = skinTwo.getDrawable("rotatex");
style.down = skinTwo.getDrawable("rotatexpress");
style.over = skinTwo.getDrawable("rotatexpress");
style.font = FontLoader.font(1f);
TextButton b = new TextButton("",style);
float w = Gdx.graphics.getWidth() / 14;
float h = Gdx.graphics.getHeight() / 12;
b.setHeight(h);
b.setWidth(w);
b.setPosition(Gdx.graphics.getWidth()-w - 3f*w, h - h / 4 + w / 3 + h);
return b;
}
示例6: ry
import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle; //导入依赖的package包/类
public static TextButton ry(){
TextButtonStyle style = new TextButtonStyle();
style.up = skinTwo.getDrawable("rotatey");
style.down = skinTwo.getDrawable("rotateypress");
style.over = skinTwo.getDrawable("rotateypress");
style.font = FontLoader.font(1f);
TextButton b = new TextButton("",style);
float w = Gdx.graphics.getWidth() / 14;
float h = Gdx.graphics.getHeight() / 12;
b.setHeight(h);
b.setWidth(w);
b.setPosition(Gdx.graphics.getWidth()-w - 1.75f* w, h - h / 4 + w / 3 + h);
return b;
}
示例7: rz
import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle; //导入依赖的package包/类
public static TextButton rz(){
TextButtonStyle style = new TextButtonStyle();
style.up = skinTwo.getDrawable("rotatez");
style.down = skinTwo.getDrawable("rotatezpress");
style.over = skinTwo.getDrawable("rotatezpress");
style.font = FontLoader.font(1f);
TextButton b = new TextButton("",style);
float w = Gdx.graphics.getWidth() / 14;
float h = Gdx.graphics.getHeight() / 12;
b.setHeight(h);
b.setWidth(w);
b.setPosition(Gdx.graphics.getWidth()-w - .5f* w, h - h / 4 + w / 3 + h);
return b;
}
示例8: cam
import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle; //导入依赖的package包/类
public static TextButton cam(){
TextButtonStyle style = new TextButtonStyle();
style.up = skinTwo.getDrawable("cam1");
style.down = skinTwo.getDrawable("cam2");
style.over = skinTwo.getDrawable("cam2");
style.font = FontLoader.font(1f);
TextButton b = new TextButton("",style);
float w = Gdx.graphics.getWidth() / 14;
float h = Gdx.graphics.getHeight() / 12;
b.setHeight(h);
b.setWidth(w);
b.setPosition(Gdx.graphics.getWidth()-w - w,
h + 7* h + h);
return b;
}
示例9: question
import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle; //导入依赖的package包/类
public static TextButton question(){
TextButtonStyle circle = makeCircleStyle();
//set button font
circle.font = FontLoader.font(.65f);
//make button
TextButton play = new TextButton("?", circle);
float w = Gdx.graphics.getWidth() / 14;
float h = Gdx.graphics.getHeight() / 12;
//set button size and position
play.setHeight(h);
play.setWidth(w);
play.setPosition(0, Gdx.graphics.getHeight()-play.getHeight()-play.getHeight()/5);
//return button
return play;
}
示例10: quit
import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle; //导入依赖的package包/类
public static TextButton quit(){
TextButtonStyle circle = makeCircleStyle();
//set button font
circle.font = FontLoader.font(.65f);
//make button
TextButton play = new TextButton("quit", circle);
float w = Gdx.graphics.getWidth() / 14;
float h = Gdx.graphics.getHeight() / 12;
//set button size and position
play.setHeight(h);
play.setWidth(w);
play.setPosition(Gdx.graphics.getWidth()-w - w,
h + 5.5f* h + h);
//return button
return play;
}
示例11: yes
import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle; //导入依赖的package包/类
public static TextButton yes(){
TextButtonStyle circle = makeCircleStyle();
//set button font
circle.font = FontLoader.font(.65f);
//make button
TextButton play = new TextButton("Y", circle);
float w = Gdx.graphics.getWidth() / 14;
float h = Gdx.graphics.getHeight() / 12;
//set button size and position
play.setHeight(h);
play.setWidth(w);
play.setPosition(Gdx.graphics.getWidth()-w - w + w/15,
h + 3.5f* h + h);
//return button
return play;
}
示例12: no
import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle; //导入依赖的package包/类
public static TextButton no(){
TextButtonStyle circle = makeCircleStyle();
//set button font
circle.font = FontLoader.font(.65f);
//make button
TextButton play = new TextButton("N", circle);
float w = Gdx.graphics.getWidth() / 14;
float h = Gdx.graphics.getHeight() / 12;
//set button size and position
play.setHeight(h);
play.setWidth(w);
play.setPosition(Gdx.graphics.getWidth()-w - 2.5f* w,
h + 3.5f* h + h);
//return button
return play;
}
示例13: init
import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle; //导入依赖的package包/类
public void init(){
stage = new Stage(new ScreenViewport());
Gdx.input.setInputProcessor(stage);
mainTable = new Table();
mainTable.setBounds(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
stage.addActor(mainTable);
font = new BitmapFont(Gdx.files.internal("font2.fnt"));
blueTextButtonStyle = new TextButtonStyle();
blueTextButtonStyle.up = TextureUtils.createDrawable(new Color(52f / 255f, 73f / 255f, 94f / 255f, 1.0f), 300, 75);
blueTextButtonStyle.down = TextureUtils.createDrawable(new Color(44f / 255f, 62f / 255f, 80f / 255f, 1.0f), 300, 75);
blueTextButtonStyle.over = TextureUtils.createDrawable(new Color(60f / 255f, 84f / 255f, 108f / 255f, 1.0f), 300, 75);
blueTextButtonStyle.font = font;
blueTextButtonStyle.fontColor = Color.BLACK;
labelStyle = new LabelStyle();
labelStyle.background = blueTextButtonStyle.up;
labelStyle.font = font;
labelStyle.fontColor = Color.WHITE;
}
示例14: StageButton
import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle; //导入依赖的package包/类
public StageButton(final Ritterhelm helm, String label, String buttonID, int x, int y){
this.helm = helm;
skin = helm.skin;
font = helm.font;
buttonAtlas = helm.buttonAtlas;
skin.addRegions(buttonAtlas);
stageButtonStyle = new TextButtonStyle();
stageButtonStyle.font = font;
stageButtonStyle.up = skin.getDrawable(buttonID);
stageButton = new TextButton(label,stageButtonStyle);
stageButton.setPosition(x, y);
}
示例15: addExit
import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle; //导入依赖的package包/类
private void addExit() {
NinePatchDrawable draw = new NinePatchDrawable(Assets.hotkey.button);
TextButtonStyle style = new ImageTextButtonStyle();
style.up = draw;
style.down = draw.tint(Color.DARK_GRAY);
style.checked = draw;
style.font = Assets.fonts.font;
TextButton btn = new TextButton("Exit", style);
btn.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
super.clicked(event, x, y);
Gdx.app.exit();
}
});
table.add(btn);
table.row();
}