added play, option, and quit buttons
This commit is contained in:
@@ -20,6 +20,7 @@ import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator;
|
||||
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.FreeTypeFontParameter;
|
||||
import com.badlogic.gdx.math.MathUtils;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.CheckBox.CheckBoxStyle;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.ImageButton.ImageButtonStyle;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Label.LabelStyle;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.List.ListStyle;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane.ScrollPaneStyle;
|
||||
@@ -230,11 +231,11 @@ public class RhythmBullet extends Game {
|
||||
getDefaultSkin().add("inverse", Color.BLACK);
|
||||
|
||||
TextButtonStyle defaultTextButton = new TextButtonStyle();
|
||||
defaultTextButton.up = getDefaultSkin().getDrawable("default-round");
|
||||
defaultTextButton.down = getDefaultSkin().getDrawable("default-round-down");
|
||||
defaultTextButton.up = getDefaultSkin().getDrawable("rect");
|
||||
defaultTextButton.down = getDefaultSkin().getDrawable("rect-down");
|
||||
defaultTextButton.font = getDefaultSkin().getFont("default-font");
|
||||
defaultTextButton.fontColor = getDefaultSkin().getColor("default");
|
||||
defaultTextButton.disabled = getDefaultSkin().getDrawable("default-round-disabled");
|
||||
defaultTextButton.disabled = getDefaultSkin().getDrawable("rect-disabled");
|
||||
getDefaultSkin().add("default", defaultTextButton);
|
||||
|
||||
TextButtonStyle subTextbutton = new TextButtonStyle(defaultTextButton);
|
||||
|
@@ -76,8 +76,8 @@ public class TitleBarVisualizer extends Group implements Disposable {
|
||||
return effect;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void act(float delta) {
|
||||
if (!lastEffect) {
|
||||
|
@@ -1,8 +1,18 @@
|
||||
package zero1hd.rhythmbullet.graphics.ui.pages;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||
import com.badlogic.gdx.math.Vector3;
|
||||
import com.badlogic.gdx.scenes.scene2d.Actor;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.ImageButton;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Label;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Table;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.ImageButton.ImageButtonStyle;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle;
|
||||
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
|
||||
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.ChangeEvent;
|
||||
import com.badlogic.gdx.utils.Align;
|
||||
|
||||
import zero1hd.rhythmbullet.RhythmBullet;
|
||||
import zero1hd.rhythmbullet.audio.MusicManager;
|
||||
@@ -15,6 +25,10 @@ public class MainPage extends Page implements OnDifferentSongListener {
|
||||
|
||||
private SongListController sc;
|
||||
private TitleBarVisualizer titleBar;
|
||||
private Table table;
|
||||
private TextButton playButton;
|
||||
private TextButton optionsButton;
|
||||
private TextButton quitButton;
|
||||
public MainPage(RhythmBullet core, Vector3 targetPosition, SongListController sc) {
|
||||
this.sc = sc;
|
||||
|
||||
@@ -29,6 +43,44 @@ public class MainPage extends Page implements OnDifferentSongListener {
|
||||
core.getDefaultSkin().getColor("default"));
|
||||
versionLabel.setPosition(3, 3);
|
||||
addActor(versionLabel);
|
||||
|
||||
table = new Table();
|
||||
table.setSize(getWidth(), titleBar.getY());
|
||||
table.align(Align.center);
|
||||
table.defaults().space(10f);
|
||||
addActor(table);
|
||||
|
||||
playButton = new TextButton("Start!", core.getDefaultSkin());
|
||||
playButton.addListener(new ChangeListener() {
|
||||
@Override
|
||||
public void changed(ChangeEvent event, Actor actor) {
|
||||
//TODO move to play screen
|
||||
}
|
||||
});
|
||||
table.add(playButton).width(Gdx.graphics.getWidth()*0.2f);
|
||||
|
||||
table.row();
|
||||
|
||||
optionsButton = new TextButton("Options", core.getDefaultSkin(), "sub");
|
||||
optionsButton.addListener(new ChangeListener() {
|
||||
@Override
|
||||
public void changed(ChangeEvent event, Actor actor) {
|
||||
//TODO move to options
|
||||
}
|
||||
});
|
||||
table.add(optionsButton).fillX();
|
||||
|
||||
table.row();
|
||||
|
||||
quitButton = new TextButton("Quit", core.getDefaultSkin(), "sub");
|
||||
quitButton.addListener(new ChangeListener() {
|
||||
@Override
|
||||
public void changed(ChangeEvent event, Actor actor) {
|
||||
Gdx.app.exit();
|
||||
System.exit(0);
|
||||
}
|
||||
});
|
||||
table.add(quitButton).fillX();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user