changed go to arrow to generic shape, added to skin definition and removed object version

This commit is contained in:
Harrison Deng 2017-04-20 00:24:29 -05:00
parent 877d0e2274
commit a7cf85a581
8 changed files with 30 additions and 49 deletions

View File

@ -244,7 +244,7 @@ left-button-down
orig: 12, 20
offset: 0, 0
index: -1
point-arrow
goto
rotate: false
xy: 1, 123
size: 101, 132

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -18,6 +18,7 @@ import com.badlogic.gdx.graphics.g2d.TextureAtlas;
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.Button.ButtonStyle;
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;
@ -177,10 +178,15 @@ public class Polyjet extends Game {
SliderStyle defaultSlider = new SliderStyle(defaultSkin.getDrawable("default-slider"), defaultSkin.getDrawable("default-slider-knob"));
defaultSkin.add("default-horizontal", defaultSlider);
ImageButtonStyle infoButton = new ImageButtonStyle();
ButtonStyle infoButton = new ButtonStyle();
infoButton.up = defaultSkin.getDrawable("holo-pane");
infoButton.down = defaultSkin.getDrawable("holo-pane-down");
defaultSkin.add("info-pane", infoButton);
defaultSkin.add("info-button", infoButton);
ButtonStyle arrowButton = new ButtonStyle();
arrowButton.down = defaultSkin.getDrawable("goto");
arrowButton.up = defaultSkin.getDrawable("goto");
defaultSkin.add("arrow-button", arrowButton);
LabelStyle defaultLabel = new LabelStyle();
defaultLabel.font = defaultSkin.getFont("default-font");
@ -208,6 +214,8 @@ public class Polyjet extends Game {
SelectBoxStyle defaultSelectBox = new SelectBoxStyle(defaultSkin.getFont("default-font"), defaultSkin.getColor("default"), defaultSkin.getDrawable("default-select"), defaultScrollPane, defaultList);
defaultSkin.add("default", defaultSelectBox);
Gdx.app.debug("Prelaunch Debug Info", "UI Skin has been defined.");
}
@Override

View File

@ -84,7 +84,7 @@ public class MainMenu extends ScreenAdapter implements TransitionAdapter {
}
});
Gdx.app.debug("Post Transition", "Beginning screen setup for Mainmenu.");
Gdx.app.debug("Post Transition", "Beginning screen setup for Main menu.");
}
@Override

View File

@ -2,13 +2,13 @@ package zero1hd.polyjet.ui;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.ui.Button;
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
import zero1hd.polyjet.Polyjet;
import zero1hd.polyjet.maps.KeyMap;
import zero1hd.polyjet.ui.builders.ArrowButton;
import zero1hd.polyjet.ui.builders.GraphicsTable;
import zero1hd.polyjet.ui.builders.SetControls;
@ -32,14 +32,12 @@ public class MoreOptionsPage extends Page {
addActor(graphicsSettings);
graphicsSettings.setVisible(false);
ArrowButton backArrow = new ArrowButton(core.defaultSkin);
backArrow.setRotation(90f);
Button backArrow = new Button(core.defaultSkin, "arrow-button");
backArrow.setPosition(30, getHeight()-backArrow.getHeight()-10);
backArrow.addListener(new ClickListener() {
backArrow.addListener(new ChangeListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
public void changed(ChangeEvent event, Actor actor) {
targetLocation.y = 0.5f*Gdx.graphics.getHeight();
super.clicked(event, x, y);
}
});
addActor(backArrow);

View File

@ -8,17 +8,16 @@ import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.InputListener;
import com.badlogic.gdx.scenes.scene2d.ui.Button;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.ProgressBar;
import com.badlogic.gdx.scenes.scene2d.ui.Slider;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.ui.TextField;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import zero1hd.polyjet.Polyjet;
import zero1hd.polyjet.screens.CreativeDebugScreen;
import zero1hd.polyjet.ui.builders.ArrowButton;
public class OptionsPage extends Page {
Table optionsTable = new Table();
@ -28,7 +27,7 @@ public class OptionsPage extends Page {
private Polyjet core;
private byte goToScreen;
private ArrowButton backSymbol;
private Button backSymbol;
public OptionsPage(final Polyjet core, final Vector3 targetPosition, final MoreOptionsPage moreOptionsPage) {
this.core = core;
optionsTable.defaults().padTop(5f).padBottom(5f);
@ -104,15 +103,13 @@ public class OptionsPage extends Page {
//Back button
backSymbol = new ArrowButton(core.defaultSkin);
backSymbol.addListener(new ClickListener() {
backSymbol = new Button(core.defaultSkin, "arrow-button");
backSymbol.addListener(new ChangeListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
public void changed(ChangeEvent event, Actor actor) {
targetPosition.x = 0.5f*Gdx.graphics.getWidth();
super.clicked(event, x, y);
}
});
backSymbol.setRotation(180);
backSymbol.setPosition(10, (getHeight()-backSymbol.getHeight())/2);
addActor(backSymbol);
@ -121,14 +118,12 @@ public class OptionsPage extends Page {
addActor(optionsTable);
ArrowButton keybindSettings = new ArrowButton(core.defaultSkin);
keybindSettings.setRotation(270f);
keybindSettings.addListener(new ClickListener() {
Button keybindSettings = new Button(core.defaultSkin, "arrow-button");
keybindSettings.addListener(new ChangeListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
public void changed(ChangeEvent event, Actor actor) {
moreOptionsPage.setControlType((byte) 0);
targetPosition.y = -0.5f*Gdx.graphics.getHeight();
super.clicked(event, x, y);
}
});
keybindSettings.setPosition(optionsTable.getWidth()/3, optionsTable.getY());
@ -137,14 +132,12 @@ public class OptionsPage extends Page {
controlsSection.setPosition(keybindSettings.getX()+(keybindSettings.getWidth()-controlsSection.getWidth())/2, keybindSettings.getHeight()+keybindSettings.getY());
addActor(controlsSection);
ArrowButton graphicsSettings = new ArrowButton(core.defaultSkin);
graphicsSettings.setRotation(270f);
graphicsSettings.addListener(new ClickListener() {
Button graphicsSettings = new Button(core.defaultSkin, "arrow-button");
graphicsSettings.addListener(new ChangeListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
public void changed(ChangeEvent event, Actor actor) {
moreOptionsPage.setControlType((byte) 1);
targetPosition.y = -0.5f*Gdx.graphics.getHeight();
super.clicked(event, x, y);
targetPosition.y = -0.5f*Gdx.graphics.getHeight();
}
});
graphicsSettings.setPosition(optionsTable.getWidth()*2/3, optionsTable.getY());

View File

@ -1,15 +0,0 @@
package zero1hd.polyjet.ui.builders;
import com.badlogic.gdx.scenes.scene2d.actions.Actions;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
public class ArrowButton extends Image {
public ArrowButton(Skin skin) {
super(skin.getDrawable("point-arrow"));
setOrigin(getWidth()/2, getHeight()/2);
setPosition(10, (getHeight()-getHeight())/2);
addAction(Actions.forever(Actions.sequence(Actions.alpha(0.5f, 1.5f), Actions.alpha(1f, 1.5f))));
}
}

View File

@ -7,12 +7,9 @@ import com.badlogic.gdx.Preferences;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.ImageButton;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.ChangeEvent;
import com.mpatric.mp3agic.ID3v2;
import com.mpatric.mp3agic.InvalidDataException;
import com.mpatric.mp3agic.Mp3File;