本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.Button.toggle方法的典型用法代码示例。如果您正苦于以下问题:Java Button.toggle方法的具体用法?Java Button.toggle怎么用?Java Button.toggle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.ui.Button
的用法示例。
在下文中一共展示了Button.toggle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: interact
import com.badlogic.gdx.scenes.scene2d.ui.Button; //导入方法依赖的package包/类
public void interact(Button sound, Button clock, Button play, AssetLoader assets, Pieces piece, boolean[][][]fixed){
if(Gdx.input.isKeyJustPressed(Input.Keys.DPAD_UP)){
if (!sound.isChecked()) {
assets.interact.play();
}
piece.up(fixed);
}
else if(Gdx.input.isKeyJustPressed(Input.Keys.DPAD_DOWN)){
if (!sound.isChecked()) {
assets.interact.play();
}
piece.down(fixed);
}
else if(Gdx.input.isKeyJustPressed(Input.Keys.DPAD_LEFT)){
if (!sound.isChecked()) {
assets.interact.play();
}
piece.left(fixed);
}
else if(Gdx.input.isKeyJustPressed(Input.Keys.DPAD_RIGHT)){
if (!sound.isChecked()) {
assets.interact.play();
}
piece.right(fixed);
}
else if(Gdx.input.isKeyJustPressed(Input.Keys.A)){
if (!sound.isChecked()) {
assets.interact.play();
}
piece.rotateX(fixed, !clock.isChecked());
}
else if(Gdx.input.isKeyJustPressed(Input.Keys.S)){
if (!sound.isChecked()) {
assets.interact.play();
}
piece.rotateY(fixed, !clock.isChecked());
}
else if(Gdx.input.isKeyJustPressed(Input.Keys.D)){
if (!sound.isChecked()) {
assets.interact.play();
}
piece.rotateZ(fixed, !clock.isChecked());
}
else if(Gdx.input.isKeyJustPressed(Input.Keys.ENTER)){
if (!sound.isChecked()) {
assets.interact.play();
}
piece.descend(fixed);
}
else if(Gdx.input.isKeyJustPressed(Input.Keys.Z)){
if (!sound.isChecked()) {
assets.interact.play();
}
clock.toggle();
}
else if(Gdx.input.isKeyJustPressed(Input.Keys.SPACE)){
if (!sound.isChecked()) {
assets.interact.play();
}
play.toggle();
}
}
示例2: interactEasy
import com.badlogic.gdx.scenes.scene2d.ui.Button; //导入方法依赖的package包/类
public void interactEasy(Button sound, Button clock, Button play, AssetLoader assets, PiecesEasy piece, boolean[][][]fixed){
if(Gdx.input.isKeyJustPressed(Input.Keys.DPAD_UP)){
if (!sound.isChecked()) {
assets.interact.play();
}
piece.up(fixed);
}
else if(Gdx.input.isKeyJustPressed(Input.Keys.DPAD_DOWN)){
if (!sound.isChecked()) {
assets.interact.play();
}
piece.down(fixed);
}
else if(Gdx.input.isKeyJustPressed(Input.Keys.DPAD_LEFT)){
if (!sound.isChecked()) {
assets.interact.play();
}
piece.left(fixed);
}
else if(Gdx.input.isKeyJustPressed(Input.Keys.DPAD_RIGHT)){
if (!sound.isChecked()) {
assets.interact.play();
}
piece.right(fixed);
}
else if(Gdx.input.isKeyJustPressed(Input.Keys.A)){
if (!sound.isChecked()) {
assets.interact.play();
}
piece.rotateX(fixed, !clock.isChecked());
}
else if(Gdx.input.isKeyJustPressed(Input.Keys.S)){
if (!sound.isChecked()) {
assets.interact.play();
}
piece.rotateY(fixed, !clock.isChecked());
}
else if(Gdx.input.isKeyJustPressed(Input.Keys.D)){
if (!sound.isChecked()) {
assets.interact.play();
}
piece.rotateZ(fixed, !clock.isChecked());
}
else if(Gdx.input.isKeyJustPressed(Input.Keys.ENTER)){
if (!sound.isChecked()) {
assets.interact.play();
}
piece.descend(fixed);
}
else if(Gdx.input.isKeyJustPressed(Input.Keys.Z)){
if (!sound.isChecked()) {
assets.interact.play();
}
clock.toggle();
}
else if(Gdx.input.isKeyJustPressed(Input.Keys.SPACE)){
if (!sound.isChecked()) {
assets.interact.play();
}
play.toggle();
}
}