本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle方法的典型用法代码示例。如果您正苦于以下问题:Java Button.ButtonStyle方法的具体用法?Java Button.ButtonStyle怎么用?Java Button.ButtonStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.ui.Button
的用法示例。
在下文中一共展示了Button.ButtonStyle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: StageControl
import com.badlogic.gdx.scenes.scene2d.ui.Button; //导入方法依赖的package包/类
public StageControl() {
// Config
config = new ConfigGeneral();
config.load();
// Spritebatch
spritebatch = new SpriteBatch();
// Screen touchable
wiiScreen = new Button(new Button.ButtonStyle());
wiiScreen.setBounds(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
wiiImage = new Texture("image/placeholder.png");
addActor(wiiScreen);
// Initialize controls
for (Control control : controls)
control.init(this);
// Audio
audioThread = new AudioThread();
audioThread.start();
// Video
videoThread = new VideoThread();
videoThread.start();
// Command
commandThread = new CommandThread();
commandThread.start();
}
示例2: GameButton
import com.badlogic.gdx.scenes.scene2d.ui.Button; //导入方法依赖的package包/类
public GameButton(float WIDTH, float HEIGHT, String drawable, boolean isCheckable) {
audioManager = AudioManager.getInstance();
skin = new Skin();
skin.addRegions(AssetsManager.getTextureAtlas());
Button.ButtonStyle buttonStyle = new Button.ButtonStyle();
buttonStyle.up = skin.getDrawable(drawable);
buttonStyle.down = skin.getDrawable(drawable + "_pressed");
if (isCheckable) {
buttonStyle.checked = skin.getDrawable(drawable + "_pressed");
}
setStyle(buttonStyle);
setSize(WIDTH, HEIGHT);
rectangle = new Rectangle(getX(),getY(),getWidth(),getHeight());
addListener(new ClickListener(){
@Override
public void clicked(InputEvent event, float x, float y) {
super.clicked(event, x, y);
audioManager.playSound(audioManager.getButtonSound());
}
});
}
示例3: initPlayerButton
import com.badlogic.gdx.scenes.scene2d.ui.Button; //导入方法依赖的package包/类
private void initPlayerButton() {
playerButton = new Button(new Button.ButtonStyle());
playerButton.setWidth(460);
playerButton.setHeight(360);
playerButton.setX(10);
playerButton.setY(170);
playerButton.setDebug(true);
stage.addActor(playerButton);
playerButton.addListener(new ClickListener() {
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
player.reactOnClick();
game.addPoint();
return super.touchDown(event, x, y, pointer, button);
}
});
}
示例4: initResetButton
import com.badlogic.gdx.scenes.scene2d.ui.Button; //导入方法依赖的package包/类
private void initResetButton() {
resetButton = new Button(new Button.ButtonStyle());
resetButton.setWidth(40);
resetButton.setHeight(20);
resetButton.setX(160);
resetButton.setY(550);
resetButton.setDebug(true);
stage.addActor(resetButton);
resetButton.addListener(new ClickListener() {
@Override
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
game.resetPoints();
return super.touchDown(event, x, y, pointer, button);
}
});
}
示例5: setStyle
import com.badlogic.gdx.scenes.scene2d.ui.Button; //导入方法依赖的package包/类
public void setStyle(EditTextStyle style) {
this.style = style;
ScrollPane.ScrollPaneStyle sps = new ScrollPane.ScrollPaneStyle();
sps.background = style.background;
this.scrollPane.setStyle(sps);
Label.LabelStyle ls = new Label.LabelStyle();
ls.font = style.font;
ls.fontColor = style.fontColor;
this.textLabel.setStyle(ls);
Button.ButtonStyle bs = new Button.ButtonStyle();
bs.up = style.editIcon;
bs.down = style.editIcon;
editButton.setStyle(bs);
}
示例6: a
import com.badlogic.gdx.scenes.scene2d.ui.Button; //导入方法依赖的package包/类
public final void a(Skin paramSkin, Stage paramStage)
{
this.b = new Table();
this.b.setX(0.0F);
this.b.setY(0.0F);
this.b.setWidth(paramStage.getWidth());
this.b.setHeight(paramStage.getHeight());
this.b.pad(15.0F);
Table localTable = new Table();
ProgressIndicator localProgressIndicator = new ProgressIndicator((ProgressIndicator.ProgressIndicatorStyle)paramSkin.get("ada-wheels-sm", ProgressIndicator.ProgressIndicatorStyle.class));
localProgressIndicator.a(true);
localTable.add(localProgressIndicator).i();
localTable.row();
localTable.add(new Label(this.a, (Label.LabelStyle)paramSkin.get("message-label", Label.LabelStyle.class))).i();
this.c = new Button((Button.ButtonStyle)paramSkin.get("default", Button.ButtonStyle.class));
this.c.setX(paramStage.getWidth());
paramStage.addActor(this.c);
this.b.add(localTable).i();
paramStage.addActor(this.b);
}
示例7: b
import com.badlogic.gdx.scenes.scene2d.ui.Button; //导入方法依赖的package包/类
public final void b(boolean paramBoolean)
{
boolean bool;
if (a() != paramBoolean)
{
if (paramBoolean)
break label34;
bool = true;
setDisabled(bool);
if (!paramBoolean)
break label39;
}
label34: label39: for (Button.ButtonStyle localButtonStyle = this.c; ; localButtonStyle = this.d)
{
setStyle(localButtonStyle);
return;
bool = false;
break;
}
}
示例8: a
import com.badlogic.gdx.scenes.scene2d.ui.Button; //导入方法依赖的package包/类
public final void a(Skin paramSkin, Stage paramStage)
{
this.k = ((Label.LabelStyle)paramSkin.get("mission-list", Label.LabelStyle.class));
this.l = ((Label.LabelStyle)paramSkin.get("mission-list-disabled", Label.LabelStyle.class));
this.d = ((TextButton.TextButtonStyle)paramSkin.get("mission-list", TextButton.TextButtonStyle.class));
this.e = ((TextButton.TextButtonStyle)paramSkin.get("mission-list-completed", TextButton.TextButtonStyle.class));
this.f = ((TextButton.TextButtonStyle)paramSkin.get("mission-list-selected", TextButton.TextButtonStyle.class));
this.g = ((Button.ButtonStyle)paramSkin.get("default", TextButton.TextButtonStyle.class));
this.h = ((Button.ButtonStyle)paramSkin.get("disabled", Button.ButtonStyle.class));
this.o = paramSkin.getDrawable("nav-button-clear");
this.b = new Table();
this.b.setWidth(paramStage.getWidth());
this.b.setHeight(paramStage.getHeight());
cc.a(this.a, new aa(paramSkin, (int)paramStage.getWidth(), cc.b(this.a), com.nianticproject.ingress.common.ui.widget.ag.c));
this.b.add(cc.c(this.a));
this.b.row();
this.c = new Table();
this.c.setWidth(-10 + (int)paramStage.getWidth());
ScrollPane localScrollPane = new ScrollPane(this.c, new ScrollPane.ScrollPaneStyle());
localScrollPane.setScrollY(0.0F);
localScrollPane.setScrollingDisabled(true, false);
this.b.add(localScrollPane).g().o().p().j().a(5.0F, 5.0F, 5.0F, 5.0F);
paramStage.addActor(this.b);
}
示例9: init
import com.badlogic.gdx.scenes.scene2d.ui.Button; //导入方法依赖的package包/类
public void init(){
Drawable imageButton = new NinePatchDrawable(new NinePatch(Assets.getManager().get(Assets.VANNEBUTTON, Texture.class)));
Button.ButtonStyle bts = new Button.ButtonStyle(imageButton,imageButton,imageButton);
augmenter.setStyle(bts);
augmenter.setSize(32, 64);
augmenter.addListener(new VanneButton());
diminuer.setStyle(bts);
diminuer.setSize(32, 64);
diminuer.addListener(new VanneButton());
table.add(diminuer);
table.add(augmenter);
table.setPosition(x*64+32,y*64+32); //les 2 (+32) sont la pour être bien aligné avec le centre de la vanne
}
示例10: q
import com.badlogic.gdx.scenes.scene2d.ui.Button; //导入方法依赖的package包/类
public q(m paramm, Skin paramSkin, Table paramTable, Stage paramStage)
{
super((Button.ButtonStyle)paramSkin.get("portal-key-chooser-handle", TextButton.TextButtonStyle.class));
this.b = paramTable;
Table localTable = new Table();
localTable.setBackground(paramSkin.getDrawable("portal-key-vert"));
add(localTable).i();
this.d = paramStage.getWidth();
this.e = 0.0F;
addListener(this.g);
}
示例11: create
import com.badlogic.gdx.scenes.scene2d.ui.Button; //导入方法依赖的package包/类
@Override
public void create () {
Gdx.app.setLogLevel(Application.LOG_DEBUG);
//Configurar cámara de libGDX
camera = new ARCamera(67,Gdx.graphics.getWidth(),Gdx.graphics.getHeight());
camera.position.set(0f,0f,1f);
camera.lookAt(0,0,0);
camera.near = 0;
camera.far = 1000f;
camera.update();
/*
* CARGAR RECURSOS
* LOAD ASSETS
*/
manager = new AssetManager();
manager.load("splash.png", Texture.class);
manager.load("cam_button_down.png", Texture.class);
manager.load("cam_button_up.png", Texture.class);
manager.finishLoading(); //Esperar hasta que carge la imagen de splash - Wait until splash image load
/* Añade los modelos para ser cargados.
* Note que los modelos no se cargan inmediatamente, se cargan utilizando manager.update() en el metodo render
* Add the models for loading.
* Note that models are not loaded inmediately, they load using manager.update() on render method
*/
manager.load("wolf.g3db",Model.class);
manager.load("koko.g3db",Model.class);
manager.load("watercraft.g3db",Model.class);
manager.load("landscape.g3db",Model.class);
// manager.load("houses.g3db",Model.class);
batch_3d = new ModelBatch();
//Adding lights
environment = new Environment();
environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 1f));
environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f));
//2D
stage = new Stage(new ScreenViewport());
splash_img = new Image(manager.get("splash.png",Texture.class));
/* Create a button to open the camera preferences activity. First we define what images will be rendered when up and down
* Crear un botón para abrir la actividad de preferencias de camara. Primero definimos que imagenes mostrar cuando esta arriba y abajo
*/
Button.ButtonStyle buttonStyle = new Button.ButtonStyle();
buttonStyle.up = new Image(manager.get("cam_button_up.png",Texture.class)).getDrawable();
buttonStyle.down = new Image(manager.get("cam_button_down.png",Texture.class)).getDrawable();
cameraPrefsButton = new Button(buttonStyle);
//Damos una posicion en la parte superior derecha de la pantalla
cameraPrefsButton.setPosition(stage.getWidth() - 20 - cameraPrefsButton.getHeight(),stage.getHeight() - 20 - cameraPrefsButton.getHeight());
/* Recognize when button is clicked and open camera preferences using arToolKitMangaer
* Reconoce cuando el botón se ha presionado y abre preferencias de cámara
*/
cameraPrefsButton.addListener(new ClickListener(){
public void clicked (InputEvent event, float x, float y) {
arToolKitManager.openCameraPreferences();
}
});
/* Let's add the splash image to the stage to be rendered while assets load on background
* Note we didn't add the button to stage, it will be added once the assets are done loading
* Añadamos la imagen de presentación (splash) para que se muestre mientras los recursos cargan en segundo plano
* Note que no añadimos el boton al stage, eso se hará una vez los recursos hayan sido cargados
*/
stage.addActor(splash_img);
/*
* Finalmente como tenemos un boton que se puede presionar, debemos hacer que el stage reciba entradas
* Finally as we have a button to be pressed, we need to make stage to receive inputs
*/
Gdx.input.setInputProcessor(stage);
}
示例12: init
import com.badlogic.gdx.scenes.scene2d.ui.Button; //导入方法依赖的package包/类
@Override
public void init(StageControl stage) {
config = new ConfigTouch();
config.load();
// Touchpad
float x = Gdx.graphics.getWidth() * (100f / 2560);
float y = Gdx.graphics.getHeight() * (100f / 1440);
float touchpadWidth = Gdx.graphics.getWidth() * (250f / 2560);
float touchpadHeight = Gdx.graphics.getHeight() * (250f / 1440);
Skin touchpadSkin = new Skin();
touchpadSkin.add("background", new Texture("image/touchpad-background.png"));
touchpadSkin.add("knob",
TextureUtil.resizeTexture("image/touchpad-knob.png", touchpadWidth / 2,
touchpadHeight / 2));
Touchpad.TouchpadStyle touchpadStyle = new Touchpad.TouchpadStyle();
touchpadStyle.background = touchpadSkin.getDrawable("background");
touchpadStyle.knob = touchpadSkin.getDrawable("knob");
touchpad = new Touchpad(10, touchpadStyle);
touchpad.setBounds(x, y, touchpadWidth, touchpadHeight);
stage.addActor(touchpad);
// A Button
float buttonWidth = touchpadWidth / 2;
float buttonHeight = touchpadHeight / 2;
Skin buttonSkin = new Skin();
buttonSkin.add("up",
TextureUtil.resizeTexture("image/button-up.png", buttonWidth, buttonHeight));
buttonSkin.add("down",
TextureUtil.resizeTexture("image/button-down.png", buttonWidth, buttonHeight));
TextButton.TextButtonStyle buttonStyle = new TextButton.TextButtonStyle();
buttonStyle.up = buttonSkin.getDrawable("up");
buttonStyle.down = buttonSkin.getDrawable("down");
buttonStyle.font = new BitmapFont(Gdx.files.internal("font/collvetica.fnt"));
buttonA = new TextButton("A", buttonStyle);
buttonA.setPosition(Gdx.graphics.getWidth() - x - buttonWidth, y + buttonHeight);
stage.addActor(buttonA);
// B Button
buttonB = new TextButton("B", buttonStyle);
buttonB.setPosition(Gdx.graphics.getWidth() - x - 2 * buttonWidth, y);
stage.addActor(buttonB);
// X Button
buttonX = new TextButton("X", buttonStyle);
buttonX.setPosition(buttonA.getX() - buttonWidth, buttonA.getY() + buttonHeight);
stage.addActor(buttonX);
// Y Button
buttonY = new TextButton("Y", buttonStyle);
buttonY.setPosition(buttonB.getX() - buttonWidth, buttonB.getY() + buttonHeight);
stage.addActor(buttonY);
// Home Button
buttonHome = new TextButton("H", buttonStyle);
buttonHome.setPosition(Gdx.graphics.getWidth() / 2 - buttonWidth / 2, 10);
stage.addActor(buttonHome);
// Minus Button
buttonMinus = new TextButton("-", buttonStyle);
buttonMinus.setPosition(buttonHome.getX() - buttonWidth, buttonHome.getY());
stage.addActor(buttonMinus);
// Plus Button
buttonPlus = new TextButton("+", buttonStyle);
buttonPlus.setPosition(buttonHome.getX() + buttonWidth, buttonHome.getY());
stage.addActor(buttonPlus);
// TODO D-pad
// Left Trigger
float triggerWidth = Gdx.graphics.getWidth() * .1f;
float triggerHeight = Gdx.graphics.getHeight() * .1f;
if (config.triggersVisible)
buttonLeftTrigger = new TextButton("L", buttonStyle);
else
buttonLeftTrigger = new Button(new Button.ButtonStyle());
buttonLeftTrigger.setBounds(0, Gdx.graphics.getHeight() - triggerHeight, triggerWidth, triggerHeight);
stage.addActor(buttonLeftTrigger);
// Right Trigger
if (config.triggersVisible)
buttonRightTrigger = new TextButton("R", buttonStyle);
else
buttonRightTrigger = new Button(new Button.ButtonStyle());
buttonRightTrigger.setBounds(Gdx.graphics.getWidth() - triggerWidth,
Gdx.graphics.getHeight() - triggerHeight, triggerWidth, triggerHeight);
stage.addActor(buttonRightTrigger);
}
示例13: setArcadeButton
import com.badlogic.gdx.scenes.scene2d.ui.Button; //导入方法依赖的package包/类
public Button setArcadeButton(Drawable d){
Button.ButtonStyle bts = new Button.ButtonStyle(d,d,d);
Button arcadeButton = new Button(bts);
arcadeButton.setSize(WIDTH/4, 3*(HEIGHT/4));
return arcadeButton;
}
示例14: d
import com.badlogic.gdx.scenes.scene2d.ui.Button; //导入方法依赖的package包/类
public d(Actor paramActor, Button.ButtonStyle paramButtonStyle)
{
super(paramActor, paramButtonStyle);
a(this);
}
示例15: m
import com.badlogic.gdx.scenes.scene2d.ui.Button; //导入方法依赖的package包/类
public m(Actor paramActor1, Actor paramActor2, Button.ButtonStyle paramButtonStyle1, Button.ButtonStyle paramButtonStyle2)
{
}