diff --git a/android/assets/shaders/mesh.fsh b/android/assets/shaders/mesh.fsh new file mode 100755 index 0000000..89c4c5f --- /dev/null +++ b/android/assets/shaders/mesh.fsh @@ -0,0 +1,10 @@ +#ifdef GL_ES +precision mediump float; +#endif + +//input from vertex shader +varying vec4 vColor; + +void main() { + gl_FragColor = vColor; +} \ No newline at end of file diff --git a/android/assets/shaders/mesh.vsh b/android/assets/shaders/mesh.vsh new file mode 100755 index 0000000..e63a394 --- /dev/null +++ b/android/assets/shaders/mesh.vsh @@ -0,0 +1,13 @@ +attribute vec2 a_position; +attribute vec4 a_color; + +//our camera matrix +uniform mat4 u_projTrans; + +//send the color out to the fragment shader +varying vec4 vColor; + +void main() { + vColor = a_color; + gl_Position = u_projTrans * vec4(a_position.xy, 0.0, 1.0); +} \ No newline at end of file diff --git a/core/src/zero1hd/rhythmbullet/graphics/meshes/Parallelogram.java b/core/src/zero1hd/rhythmbullet/graphics/meshes/Parallelogram.java new file mode 100755 index 0000000..414c215 --- /dev/null +++ b/core/src/zero1hd/rhythmbullet/graphics/meshes/Parallelogram.java @@ -0,0 +1,84 @@ +package zero1hd.rhythmbullet.graphics.meshes; + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.GL20; +import com.badlogic.gdx.graphics.Mesh; +import com.badlogic.gdx.graphics.OrthographicCamera; +import com.badlogic.gdx.graphics.VertexAttribute; +import com.badlogic.gdx.graphics.VertexAttributes.Usage; +import com.badlogic.gdx.graphics.glutils.ShaderProgram; + +public class Parallelogram { + private Mesh mesh; + private OrthographicCamera cam; + private ShaderProgram shader; + + public final int POSITION_VARS = 2; + public final int COLOR_VARS = 1; //Packed color data + public final int TOTAL_VARS = POSITION_VARS + COLOR_VARS; + public final int MAX_QUADS = 1; + public final int MAX_VERTS = 4 * MAX_QUADS; + + private float[] verts = new float[MAX_VERTS * TOTAL_VARS]; + + + public Parallelogram(OrthographicCamera camera) { + this.cam = camera; + + mesh = new Mesh(true, MAX_VERTS, 0, new VertexAttribute(Usage.Position, POSITION_VARS, "a_position"), + //still expects 4 color components + new VertexAttribute(Usage.ColorPacked, 4, "a_color")); + } + private int idx = 0; + + public void drawParallelogram(float x, float y, float width, float height, float topOffset, Color color) { + if (idx >= verts.length) { + flush(); + } + + float c = color.toFloatBits(); + + verts[idx++] = x; + verts[idx++] = y; + verts[idx++] = c; + + verts[idx++] = x + width; + verts[idx++] = y; + verts[idx++] = c; + + verts[idx++] = x + width + topOffset; + verts[idx++] = y + height; + verts[idx++] = c; + + verts[idx++] = x + topOffset; + verts[idx++] = y + height; + verts[idx++] = c; + } + + private void flush() { + if (idx != 0) { + mesh.setVertices(verts); + + Gdx.gl.glDepthMask(false); + Gdx.gl.glEnable(GL20.GL_BLEND); + Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA); + + int vertCount = idx/TOTAL_VARS; + + cam.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); + + shader.begin(); + + shader.setUniformMatrix("u_projTrans", cam.combined); + + mesh.render(shader, GL20.GL_TRIANGLES, 0, vertCount); + + shader.end(); + + Gdx.gl.glDepthMask(true); + + idx = 0; + } + } +} diff --git a/core/src/zero1hd/rhythmbullet/ui/components/AudioGraph.java b/core/src/zero1hd/rhythmbullet/graphics/ui/components/AudioGraph.java similarity index 95% rename from core/src/zero1hd/rhythmbullet/ui/components/AudioGraph.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/components/AudioGraph.java index aaa00f8..4156526 100755 --- a/core/src/zero1hd/rhythmbullet/ui/components/AudioGraph.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/components/AudioGraph.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.components; +package zero1hd.rhythmbullet.graphics.ui.components; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Keys; diff --git a/core/src/zero1hd/rhythmbullet/ui/components/AudioGraphRelation.java b/core/src/zero1hd/rhythmbullet/graphics/ui/components/AudioGraphRelation.java similarity index 95% rename from core/src/zero1hd/rhythmbullet/ui/components/AudioGraphRelation.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/components/AudioGraphRelation.java index 8d7a506..82eeaf6 100755 --- a/core/src/zero1hd/rhythmbullet/ui/components/AudioGraphRelation.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/components/AudioGraphRelation.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.components; +package zero1hd.rhythmbullet.graphics.ui.components; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Keys; diff --git a/core/src/zero1hd/rhythmbullet/ui/components/GraphicsTable.java b/core/src/zero1hd/rhythmbullet/graphics/ui/components/GraphicsTable.java similarity index 97% rename from core/src/zero1hd/rhythmbullet/ui/components/GraphicsTable.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/components/GraphicsTable.java index 49494ba..fd037bb 100755 --- a/core/src/zero1hd/rhythmbullet/ui/components/GraphicsTable.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/components/GraphicsTable.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.components; +package zero1hd.rhythmbullet.graphics.ui.components; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Preferences; diff --git a/core/src/zero1hd/rhythmbullet/ui/components/HealthBar.java b/core/src/zero1hd/rhythmbullet/graphics/ui/components/HealthBar.java similarity index 92% rename from core/src/zero1hd/rhythmbullet/ui/components/HealthBar.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/components/HealthBar.java index 100f619..c7df9ce 100755 --- a/core/src/zero1hd/rhythmbullet/ui/components/HealthBar.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/components/HealthBar.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.components; +package zero1hd.rhythmbullet.graphics.ui.components; import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.scenes.scene2d.actions.Actions; diff --git a/core/src/zero1hd/rhythmbullet/ui/components/KeySetter.java b/core/src/zero1hd/rhythmbullet/graphics/ui/components/KeySetter.java similarity index 97% rename from core/src/zero1hd/rhythmbullet/ui/components/KeySetter.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/components/KeySetter.java index 69b1ee3..1a30a7f 100755 --- a/core/src/zero1hd/rhythmbullet/ui/components/KeySetter.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/components/KeySetter.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.components; +package zero1hd.rhythmbullet.graphics.ui.components; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Keys; diff --git a/core/src/zero1hd/rhythmbullet/ui/components/MusicSelectable.java b/core/src/zero1hd/rhythmbullet/graphics/ui/components/MusicSelectable.java similarity index 97% rename from core/src/zero1hd/rhythmbullet/ui/components/MusicSelectable.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/components/MusicSelectable.java index 7541bb3..fa5e4e6 100755 --- a/core/src/zero1hd/rhythmbullet/ui/components/MusicSelectable.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/components/MusicSelectable.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.components; +package zero1hd.rhythmbullet.graphics.ui.components; import com.badlogic.gdx.Preferences; import com.badlogic.gdx.files.FileHandle; diff --git a/core/src/zero1hd/rhythmbullet/ui/components/ScrollText.java b/core/src/zero1hd/rhythmbullet/graphics/ui/components/ScrollText.java similarity index 94% rename from core/src/zero1hd/rhythmbullet/ui/components/ScrollText.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/components/ScrollText.java index 2a30c50..ec13b7d 100755 --- a/core/src/zero1hd/rhythmbullet/ui/components/ScrollText.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/components/ScrollText.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.components; +package zero1hd.rhythmbullet.graphics.ui.components; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.g2d.Batch; diff --git a/core/src/zero1hd/rhythmbullet/ui/components/SetControls.java b/core/src/zero1hd/rhythmbullet/graphics/ui/components/SetControls.java similarity index 98% rename from core/src/zero1hd/rhythmbullet/ui/components/SetControls.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/components/SetControls.java index 932b2cc..94a5789 100755 --- a/core/src/zero1hd/rhythmbullet/ui/components/SetControls.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/components/SetControls.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.components; +package zero1hd.rhythmbullet.graphics.ui.components; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.scenes.scene2d.Actor; diff --git a/core/src/zero1hd/rhythmbullet/ui/components/SetResolutionButton.java b/core/src/zero1hd/rhythmbullet/graphics/ui/components/SetResolutionButton.java similarity index 92% rename from core/src/zero1hd/rhythmbullet/ui/components/SetResolutionButton.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/components/SetResolutionButton.java index 436f05b..f321791 100755 --- a/core/src/zero1hd/rhythmbullet/ui/components/SetResolutionButton.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/components/SetResolutionButton.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.components; +package zero1hd.rhythmbullet.graphics.ui.components; import java.awt.Dimension; import java.awt.Toolkit; diff --git a/core/src/zero1hd/rhythmbullet/graphics/ui/components/TitleBarVisualizer.java b/core/src/zero1hd/rhythmbullet/graphics/ui/components/TitleBarVisualizer.java new file mode 100755 index 0000000..572b8c0 --- /dev/null +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/components/TitleBarVisualizer.java @@ -0,0 +1,67 @@ +package zero1hd.rhythmbullet.graphics.ui.components; + +import com.badlogic.gdx.assets.AssetManager; +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.Pixmap; +import com.badlogic.gdx.graphics.Pixmap.Format; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.Sprite; +import com.badlogic.gdx.scenes.scene2d.Group; +import com.badlogic.gdx.scenes.scene2d.ui.Image; +import com.badlogic.gdx.utils.Disposable; + +public class TitleBarVisualizer extends Group implements Disposable { + private Visualizer hvisual; + private Sprite backgroundBar; + private Texture backgroundTexture; + private Image titleImage; + + public TitleBarVisualizer(AssetManager assets) { + if (assets == null) throw new NullPointerException("TitleBarVisualizer requires assets manager... ITS NULL YOU FOOL"); + + hvisual = new Visualizer(); + addActor(hvisual); + + Pixmap pixmap = new Pixmap(2, 2, Format.RGBA8888); + pixmap.setColor(Color.WHITE); + pixmap.fill(); + backgroundTexture = new Texture(pixmap); + pixmap.dispose(); + backgroundBar = new Sprite(backgroundTexture); + + titleImage = new Image(assets.get("title.png", Texture.class)); + addActor(titleImage); + + backgroundBar.setPosition(getX(), getY()); + backgroundBar.setRotation(getRotation()); + backgroundBar.setSize(getWidth(), getHeight()); + hvisual.setY(getHeight()); + } + + @Override + public void act(float delta) { + super.act(delta); + } + + public Visualizer getHvisual() { + return hvisual; + } + + @Override + public void dispose() { + backgroundTexture.dispose(); + backgroundTexture = null; + } + + @Override + public void setColor(Color color) { + backgroundBar.setColor(color); + super.setColor(color); + } + + @Override + public void setColor(float r, float g, float b, float a) { + backgroundBar.setColor(r, g, b, a); + super.setColor(r, g, b, a); + } +} diff --git a/core/src/zero1hd/rhythmbullet/ui/components/Visualizer.java b/core/src/zero1hd/rhythmbullet/graphics/ui/components/Visualizer.java similarity index 95% rename from core/src/zero1hd/rhythmbullet/ui/components/Visualizer.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/components/Visualizer.java index 477174f..3ced7b6 100755 --- a/core/src/zero1hd/rhythmbullet/ui/components/Visualizer.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/components/Visualizer.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.components; +package zero1hd.rhythmbullet.graphics.ui.components; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.g2d.Batch; diff --git a/core/src/zero1hd/rhythmbullet/ui/pages/AnalyzePage.java b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/AnalyzePage.java similarity index 96% rename from core/src/zero1hd/rhythmbullet/ui/pages/AnalyzePage.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/pages/AnalyzePage.java index cd20ff5..7feeadd 100755 --- a/core/src/zero1hd/rhythmbullet/ui/pages/AnalyzePage.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/AnalyzePage.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.pages; +package zero1hd.rhythmbullet.graphics.ui.pages; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; @@ -23,8 +23,8 @@ import zero1hd.rhythmbullet.audio.MusicManager; import zero1hd.rhythmbullet.audio.SongInfo; import zero1hd.rhythmbullet.audio.map.GamePlayMap; import zero1hd.rhythmbullet.audio.map.RhythmMapAlgorithm; +import zero1hd.rhythmbullet.graphics.ui.components.ScrollText; import zero1hd.rhythmbullet.screens.GameScreen; -import zero1hd.rhythmbullet.ui.components.ScrollText; import zero1hd.rhythmbullet.util.MiniEvents; import zero1hd.rhythmbullet.util.MiniListener; diff --git a/core/src/zero1hd/rhythmbullet/ui/pages/CreditsPage.java b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/CreditsPage.java similarity index 95% rename from core/src/zero1hd/rhythmbullet/ui/pages/CreditsPage.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/pages/CreditsPage.java index cfd68f8..b087ef8 100755 --- a/core/src/zero1hd/rhythmbullet/ui/pages/CreditsPage.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/CreditsPage.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.pages; +package zero1hd.rhythmbullet.graphics.ui.pages; import com.badlogic.gdx.scenes.scene2d.ui.Label; import com.badlogic.gdx.scenes.scene2d.ui.Skin; diff --git a/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MainPage.java b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MainPage.java new file mode 100755 index 0000000..f7d3e46 --- /dev/null +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MainPage.java @@ -0,0 +1,46 @@ +package zero1hd.rhythmbullet.graphics.ui.pages; + +import com.badlogic.gdx.graphics.g2d.Batch; +import com.badlogic.gdx.math.Vector3; +import com.badlogic.gdx.scenes.scene2d.ui.Label; + +import zero1hd.rhythmbullet.RhythmBullet; +import zero1hd.rhythmbullet.audio.MusicManager; +import zero1hd.rhythmbullet.audio.SongListController; +import zero1hd.rhythmbullet.events.OnDifferentSongListener; +import zero1hd.rhythmbullet.graphics.ui.components.TitleBarVisualizer; + +public class MainPage extends Page implements OnDifferentSongListener { + private Label versionLabel; + + private SongListController sc; + private TitleBarVisualizer titleBar; + public MainPage(RhythmBullet core, Vector3 targetPosition, SongListController sc) { + this.sc = sc; + + titleBar = new TitleBarVisualizer(core.getAssetManager()); + addActor(titleBar); + + sc.addOnDifferentSongListener(this); + + versionLabel = new Label("Version: " + RhythmBullet.VERSION, core.getDefaultSkin(), "sub-font", + core.getDefaultSkin().getColor("default")); + versionLabel.setPosition(3, 3); + addActor(versionLabel); + } + + @Override + public void act(float delta) { + super.act(delta); + } + + @Override + public void draw(Batch batch, float parentAlpha) { + super.draw(batch, parentAlpha); + } + + @Override + public void onDifferentSong(MusicManager mdp) { + titleBar.getHvisual().setMDP(mdp); + } +} diff --git a/core/src/zero1hd/rhythmbullet/ui/pages/MoreOptionsPage.java b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MoreOptionsPage.java similarity index 92% rename from core/src/zero1hd/rhythmbullet/ui/pages/MoreOptionsPage.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/pages/MoreOptionsPage.java index 97e7cfc..5bfc877 100755 --- a/core/src/zero1hd/rhythmbullet/ui/pages/MoreOptionsPage.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MoreOptionsPage.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.pages; +package zero1hd.rhythmbullet.graphics.ui.pages; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.math.Vector3; @@ -9,8 +9,8 @@ import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; import zero1hd.rhythmbullet.RhythmBullet; import zero1hd.rhythmbullet.controls.KeyMap; -import zero1hd.rhythmbullet.ui.components.GraphicsTable; -import zero1hd.rhythmbullet.ui.components.SetControls; +import zero1hd.rhythmbullet.graphics.ui.components.GraphicsTable; +import zero1hd.rhythmbullet.graphics.ui.components.SetControls; public class MoreOptionsPage extends Page { private KeyMap keymap; diff --git a/core/src/zero1hd/rhythmbullet/ui/pages/MusicSelectionPage.java b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicSelectionPage.java similarity index 93% rename from core/src/zero1hd/rhythmbullet/ui/pages/MusicSelectionPage.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicSelectionPage.java index a104b4e..68d28b8 100755 --- a/core/src/zero1hd/rhythmbullet/ui/pages/MusicSelectionPage.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicSelectionPage.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.pages; +package zero1hd.rhythmbullet.graphics.ui.pages; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -18,7 +18,7 @@ import com.badlogic.gdx.utils.Array; import zero1hd.rhythmbullet.audio.SongInfo; import zero1hd.rhythmbullet.audio.SongList; -import zero1hd.rhythmbullet.ui.components.MusicSelectable; +import zero1hd.rhythmbullet.graphics.ui.components.MusicSelectable; import zero1hd.rhythmbullet.util.MiniEvents; public class MusicSelectionPage extends Page { diff --git a/core/src/zero1hd/rhythmbullet/ui/pages/MusicStatusPage.java b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicStatusPage.java similarity index 93% rename from core/src/zero1hd/rhythmbullet/ui/pages/MusicStatusPage.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicStatusPage.java index aadc92c..b67eb1e 100755 --- a/core/src/zero1hd/rhythmbullet/ui/pages/MusicStatusPage.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicStatusPage.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.pages; +package zero1hd.rhythmbullet.graphics.ui.pages; import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.scenes.scene2d.Actor; diff --git a/core/src/zero1hd/rhythmbullet/ui/pages/OptionsPage.java b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/OptionsPage.java similarity index 96% rename from core/src/zero1hd/rhythmbullet/ui/pages/OptionsPage.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/pages/OptionsPage.java index ed6e97c..7621e92 100755 --- a/core/src/zero1hd/rhythmbullet/ui/pages/OptionsPage.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/OptionsPage.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.pages; +package zero1hd.rhythmbullet.graphics.ui.pages; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Keys; diff --git a/core/src/zero1hd/rhythmbullet/ui/pages/Page.java b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/Page.java similarity index 92% rename from core/src/zero1hd/rhythmbullet/ui/pages/Page.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/pages/Page.java index 6e50916..bdfc17b 100755 --- a/core/src/zero1hd/rhythmbullet/ui/pages/Page.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/Page.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.pages; +package zero1hd.rhythmbullet.graphics.ui.pages; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.scenes.scene2d.Group; diff --git a/core/src/zero1hd/rhythmbullet/ui/pages/StatPage.java b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/StatPage.java similarity index 94% rename from core/src/zero1hd/rhythmbullet/ui/pages/StatPage.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/pages/StatPage.java index dc2128c..63446e6 100755 --- a/core/src/zero1hd/rhythmbullet/ui/pages/StatPage.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/StatPage.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.pages; +package zero1hd.rhythmbullet.graphics.ui.pages; import com.badlogic.gdx.scenes.scene2d.ui.Label; import com.badlogic.gdx.scenes.scene2d.ui.Skin; diff --git a/core/src/zero1hd/rhythmbullet/ui/windows/BeatViewer.java b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/BeatViewer.java similarity index 98% rename from core/src/zero1hd/rhythmbullet/ui/windows/BeatViewer.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/windows/BeatViewer.java index 1a9a59c..9b5c3bc 100755 --- a/core/src/zero1hd/rhythmbullet/ui/windows/BeatViewer.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/BeatViewer.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.windows; +package zero1hd.rhythmbullet.graphics.ui.windows; import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.Pixmap.Format; diff --git a/core/src/zero1hd/rhythmbullet/ui/windows/DifficultyWindow.java b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/DifficultyWindow.java similarity index 94% rename from core/src/zero1hd/rhythmbullet/ui/windows/DifficultyWindow.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/windows/DifficultyWindow.java index f2e98c7..2aea744 100755 --- a/core/src/zero1hd/rhythmbullet/ui/windows/DifficultyWindow.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/DifficultyWindow.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.windows; +package zero1hd.rhythmbullet.graphics.ui.windows; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.ui.Label; diff --git a/core/src/zero1hd/rhythmbullet/ui/windows/FPSWindow.java b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/FPSWindow.java similarity index 88% rename from core/src/zero1hd/rhythmbullet/ui/windows/FPSWindow.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/windows/FPSWindow.java index 7340774..6fe0d13 100755 --- a/core/src/zero1hd/rhythmbullet/ui/windows/FPSWindow.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/FPSWindow.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.windows; +package zero1hd.rhythmbullet.graphics.ui.windows; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.scenes.scene2d.ui.Label; diff --git a/core/src/zero1hd/rhythmbullet/ui/windows/LoadingWindow.java b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/LoadingWindow.java similarity index 95% rename from core/src/zero1hd/rhythmbullet/ui/windows/LoadingWindow.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/windows/LoadingWindow.java index 1a69206..83665a9 100755 --- a/core/src/zero1hd/rhythmbullet/ui/windows/LoadingWindow.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/LoadingWindow.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.windows; +package zero1hd.rhythmbullet.graphics.ui.windows; import com.badlogic.gdx.assets.AssetManager; import com.badlogic.gdx.audio.Sound; diff --git a/core/src/zero1hd/rhythmbullet/ui/windows/MusicController.java b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/MusicController.java similarity index 95% rename from core/src/zero1hd/rhythmbullet/ui/windows/MusicController.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/windows/MusicController.java index 212d2d2..84a3b82 100755 --- a/core/src/zero1hd/rhythmbullet/ui/windows/MusicController.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/MusicController.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.windows; +package zero1hd.rhythmbullet.graphics.ui.windows; import com.badlogic.gdx.Input.Keys; import com.badlogic.gdx.audio.Music; diff --git a/core/src/zero1hd/rhythmbullet/ui/windows/MusicSelector.java b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/MusicSelector.java similarity index 94% rename from core/src/zero1hd/rhythmbullet/ui/windows/MusicSelector.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/windows/MusicSelector.java index cf6447d..bbc7bec 100755 --- a/core/src/zero1hd/rhythmbullet/ui/windows/MusicSelector.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/MusicSelector.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.windows; +package zero1hd.rhythmbullet.graphics.ui.windows; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.files.FileHandle; diff --git a/core/src/zero1hd/rhythmbullet/ui/windows/NoticeWindow.java b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/NoticeWindow.java similarity index 94% rename from core/src/zero1hd/rhythmbullet/ui/windows/NoticeWindow.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/windows/NoticeWindow.java index 4deb847..cdf9866 100755 --- a/core/src/zero1hd/rhythmbullet/ui/windows/NoticeWindow.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/NoticeWindow.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.windows; +package zero1hd.rhythmbullet.graphics.ui.windows; import com.badlogic.gdx.assets.AssetManager; import com.badlogic.gdx.audio.Sound; diff --git a/core/src/zero1hd/rhythmbullet/ui/windows/PauseMenu.java b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/PauseMenu.java similarity index 90% rename from core/src/zero1hd/rhythmbullet/ui/windows/PauseMenu.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/windows/PauseMenu.java index 0f83f6e..757e9d0 100755 --- a/core/src/zero1hd/rhythmbullet/ui/windows/PauseMenu.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/PauseMenu.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.windows; +package zero1hd.rhythmbullet.graphics.ui.windows; import com.badlogic.gdx.scenes.scene2d.ui.Label; import com.badlogic.gdx.scenes.scene2d.ui.Skin; diff --git a/core/src/zero1hd/rhythmbullet/ui/windows/Spawnables.java b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/Spawnables.java similarity index 88% rename from core/src/zero1hd/rhythmbullet/ui/windows/Spawnables.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/windows/Spawnables.java index 0aface1..f08137e 100755 --- a/core/src/zero1hd/rhythmbullet/ui/windows/Spawnables.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/Spawnables.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.windows; +package zero1hd.rhythmbullet.graphics.ui.windows; import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; import com.badlogic.gdx.scenes.scene2d.ui.Skin; diff --git a/core/src/zero1hd/rhythmbullet/ui/windows/SpawnerWindow.java b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/SpawnerWindow.java similarity index 96% rename from core/src/zero1hd/rhythmbullet/ui/windows/SpawnerWindow.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/windows/SpawnerWindow.java index ce76dd3..12d5f92 100755 --- a/core/src/zero1hd/rhythmbullet/ui/windows/SpawnerWindow.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/SpawnerWindow.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.windows; +package zero1hd.rhythmbullet.graphics.ui.windows; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Keys; diff --git a/core/src/zero1hd/rhythmbullet/ui/windows/VolumeWindow.java b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/VolumeWindow.java similarity index 95% rename from core/src/zero1hd/rhythmbullet/ui/windows/VolumeWindow.java rename to core/src/zero1hd/rhythmbullet/graphics/ui/windows/VolumeWindow.java index 5f6f839..32eba52 100755 --- a/core/src/zero1hd/rhythmbullet/ui/windows/VolumeWindow.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/windows/VolumeWindow.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.windows; +package zero1hd.rhythmbullet.graphics.ui.windows; import com.badlogic.gdx.Preferences; import com.badlogic.gdx.math.MathUtils; diff --git a/core/src/zero1hd/rhythmbullet/screens/MainMenu.java b/core/src/zero1hd/rhythmbullet/screens/MainMenu.java index 2ae2d9a..a5d06c0 100755 --- a/core/src/zero1hd/rhythmbullet/screens/MainMenu.java +++ b/core/src/zero1hd/rhythmbullet/screens/MainMenu.java @@ -13,11 +13,11 @@ import com.badlogic.gdx.utils.viewport.ScreenViewport; import zero1hd.rhythmbullet.RhythmBullet; import zero1hd.rhythmbullet.audio.SongListController; +import zero1hd.rhythmbullet.graphics.ui.pages.CreditsPage; +import zero1hd.rhythmbullet.graphics.ui.pages.MainPage; +import zero1hd.rhythmbullet.graphics.ui.pages.MoreOptionsPage; +import zero1hd.rhythmbullet.graphics.ui.pages.OptionsPage; import zero1hd.rhythmbullet.audio.SongList; -import zero1hd.rhythmbullet.ui.pages.CreditsPage; -import zero1hd.rhythmbullet.ui.pages.MainPage; -import zero1hd.rhythmbullet.ui.pages.MoreOptionsPage; -import zero1hd.rhythmbullet.ui.pages.OptionsPage; import zero1hd.rhythmbullet.util.TransitionAdapter; public class MainMenu extends ScreenAdapter implements TransitionAdapter { diff --git a/core/src/zero1hd/rhythmbullet/screens/PreGameScreen.java b/core/src/zero1hd/rhythmbullet/screens/PreGameScreen.java index c824de6..055b348 100755 --- a/core/src/zero1hd/rhythmbullet/screens/PreGameScreen.java +++ b/core/src/zero1hd/rhythmbullet/screens/PreGameScreen.java @@ -9,8 +9,8 @@ import com.badlogic.gdx.utils.viewport.ScreenViewport; import zero1hd.rhythmbullet.RhythmBullet; import zero1hd.rhythmbullet.audio.SongList; -import zero1hd.rhythmbullet.ui.pages.AnalyzePage; -import zero1hd.rhythmbullet.ui.pages.MusicSelectionPage; +import zero1hd.rhythmbullet.graphics.ui.pages.AnalyzePage; +import zero1hd.rhythmbullet.graphics.ui.pages.MusicSelectionPage; import zero1hd.rhythmbullet.util.MiniEvents; import zero1hd.rhythmbullet.util.MiniListener; import zero1hd.rhythmbullet.util.TransitionAdapter; diff --git a/core/src/zero1hd/rhythmbullet/stages/CreativeHUD.java b/core/src/zero1hd/rhythmbullet/stages/CreativeHUD.java index 222bcf0..d661d9f 100755 --- a/core/src/zero1hd/rhythmbullet/stages/CreativeHUD.java +++ b/core/src/zero1hd/rhythmbullet/stages/CreativeHUD.java @@ -18,15 +18,15 @@ import zero1hd.rhythmbullet.audio.AudioAnalyzer; import zero1hd.rhythmbullet.audio.AudioDataPackage; import zero1hd.rhythmbullet.audio.SongList; import zero1hd.rhythmbullet.audio.map.RhythmMapAlgorithm; +import zero1hd.rhythmbullet.graphics.ui.components.AudioGraph; +import zero1hd.rhythmbullet.graphics.ui.windows.BeatViewer; +import zero1hd.rhythmbullet.graphics.ui.windows.DifficultyWindow; +import zero1hd.rhythmbullet.graphics.ui.windows.FPSWindow; +import zero1hd.rhythmbullet.graphics.ui.windows.MusicController; +import zero1hd.rhythmbullet.graphics.ui.windows.MusicSelector; +import zero1hd.rhythmbullet.graphics.ui.windows.SpawnerWindow; +import zero1hd.rhythmbullet.graphics.ui.windows.VolumeWindow; import zero1hd.rhythmbullet.screens.MainMenu; -import zero1hd.rhythmbullet.ui.components.AudioGraph; -import zero1hd.rhythmbullet.ui.windows.BeatViewer; -import zero1hd.rhythmbullet.ui.windows.DifficultyWindow; -import zero1hd.rhythmbullet.ui.windows.FPSWindow; -import zero1hd.rhythmbullet.ui.windows.MusicController; -import zero1hd.rhythmbullet.ui.windows.MusicSelector; -import zero1hd.rhythmbullet.ui.windows.SpawnerWindow; -import zero1hd.rhythmbullet.ui.windows.VolumeWindow; import zero1hd.rhythmbullet.util.MiniEvents; import zero1hd.rhythmbullet.util.MiniListener; diff --git a/core/src/zero1hd/rhythmbullet/stages/GameHUD.java b/core/src/zero1hd/rhythmbullet/stages/GameHUD.java index 24e744c..0bd6d3a 100755 --- a/core/src/zero1hd/rhythmbullet/stages/GameHUD.java +++ b/core/src/zero1hd/rhythmbullet/stages/GameHUD.java @@ -20,9 +20,9 @@ import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; import zero1hd.rhythmbullet.RhythmBullet; import zero1hd.rhythmbullet.audio.MusicManager; -import zero1hd.rhythmbullet.ui.components.HealthBar; -import zero1hd.rhythmbullet.ui.windows.FPSWindow; -import zero1hd.rhythmbullet.ui.windows.PauseMenu; +import zero1hd.rhythmbullet.graphics.ui.components.HealthBar; +import zero1hd.rhythmbullet.graphics.ui.windows.FPSWindow; +import zero1hd.rhythmbullet.graphics.ui.windows.PauseMenu; import zero1hd.rhythmbullet.util.ScoreManager; public class GameHUD extends Stage { diff --git a/core/src/zero1hd/rhythmbullet/ui/pages/MainPage.java b/core/src/zero1hd/rhythmbullet/ui/pages/MainPage.java deleted file mode 100755 index d982ce6..0000000 --- a/core/src/zero1hd/rhythmbullet/ui/pages/MainPage.java +++ /dev/null @@ -1,139 +0,0 @@ -package zero1hd.rhythmbullet.ui.pages; - -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.Texture; -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.InputEvent; -import com.badlogic.gdx.scenes.scene2d.actions.Actions; -import com.badlogic.gdx.scenes.scene2d.ui.Image; -import com.badlogic.gdx.scenes.scene2d.ui.Label; -import com.badlogic.gdx.scenes.scene2d.ui.TextButton; -import com.badlogic.gdx.scenes.scene2d.ui.WidgetGroup; -import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; -import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; - -import zero1hd.rhythmbullet.RhythmBullet; -import zero1hd.rhythmbullet.audio.MusicManager; -import zero1hd.rhythmbullet.audio.SongListController; -import zero1hd.rhythmbullet.events.OnDifferentSongListener; -import zero1hd.rhythmbullet.screens.PreGameScreen; -import zero1hd.rhythmbullet.ui.components.Visualizer; - -public class MainPage extends Page implements OnDifferentSongListener { - private Image title; - private Label versionLabel; - private TextButton options; - private Image cyberCircle; - private Label begin; - private TextButton quit; - private TextButton credits; - private WidgetGroup playButton; - - private SongListController sc; - private Visualizer hvisual; - - public MainPage(RhythmBullet core, Vector3 targetPosition, SongListController sc) { - hvisual = new Visualizer(); - this.sc = sc; - sc.addOnDifferentSongListener(this); - hvisual.setMDP(sc.getCurrentSong()); - addActor(hvisual); - title = new Image(core.getAssetManager().get("title.png", Texture.class)); - title.setPosition(10, getHeight() - title.getHeight()-30); - addActor(title); - versionLabel = new Label("Version: " + RhythmBullet.VERSION, core.getDefaultSkin(), "sub-font", - core.getDefaultSkin().getColor("default")); - versionLabel.setPosition(3, 3); - addActor(versionLabel); - - options = new TextButton(" Options ", core.getDefaultSkin(), "left"); - options.addListener(new ChangeListener() { - @Override - public void changed(ChangeEvent event, Actor actor) { - targetPosition.x = 1.5f * getWidth(); - } - }); - options.setPosition(-options.getWidth(), title.getY() - options.getHeight() - 30); - options.addAction(Actions.sequence(Actions.delay(0.25f), Actions.moveTo(0, options.getY(), 0.5f))); - addActor(options); - - credits = new TextButton(" Credits ", core.getDefaultSkin(), "left"); - credits.addListener(new ChangeListener() { - - @Override - public void changed(ChangeEvent event, Actor actor) { - targetPosition.y = 1.5f * getHeight(); - } - }); - credits.setPosition(-credits.getWidth(), options.getY() - credits.getHeight() - 10); - credits.addAction(Actions.sequence(Actions.delay(0.5f), Actions.moveTo(0, credits.getY(), 0.5f))); - addActor(credits); - - quit = new TextButton(" Quit ", core.getDefaultSkin(), "left"); - quit.setPosition(-quit.getWidth(), credits.getY() - credits.getHeight() - 10); - quit.addListener(new ChangeListener() { - - @Override - public void changed(ChangeEvent event, Actor actor) { - Gdx.app.exit(); - } - - }); - quit.addAction(Actions.sequence(Actions.delay(0.75f), Actions.moveTo(0, quit.getY(), 0.5f))); - addActor(quit); - - // begin play button - playButton = new WidgetGroup(); - - cyberCircle = new Image(core.getAssetManager().get("Tech-Circle1.png", Texture.class)); - cyberCircle.setOrigin(cyberCircle.getWidth() / 2, cyberCircle.getHeight() / 2); - cyberCircle.setColor(0.7f, 0.7f, 0.7f, 0.8f); - cyberCircle.addAction(Actions.forever(Actions.rotateBy(-360f, 10f))); - playButton.addActor(cyberCircle); - playButton.setSize(cyberCircle.getWidth(), cyberCircle.getHeight()); - - begin = new Label("Play", core.getDefaultSkin(), "special-font", core.getDefaultSkin().getColor("default")); - begin.setColor(1f, 1f, 1f, 1f); - playButton.addActor(begin); - begin.setPosition(((playButton.getWidth() - begin.getWidth()) / 2)-10, - (playButton.getHeight() - begin.getHeight()) / 2); - playButton.setPosition(getWidth() - cyberCircle.getWidth() * 3 / 4, -cyberCircle.getHeight() / 4); - - // begin animation of begin button - playButton.addListener(new ClickListener() { - @Override - public void clicked(InputEvent event, float x, float y) { - if (targetPosition.x == 0.5f * getWidth()) { - cyberCircle.addAction( - Actions.sequence(Actions.parallel(Actions.scaleBy(2f, 2f, 0.25f), Actions.fadeOut(0.25f)), - Actions.run(new Runnable() { - @Override - public void run() { - core.setScreen(new PreGameScreen(core, sc.getSongList())); - } - }), Actions.parallel(Actions.scaleTo(1, 1), Actions.alpha(0.6f)))); - } - super.clicked(event, x, y); - } - }); - addActor(playButton); - // end play button - } - - @Override - public void act(float delta) { - super.act(delta); - } - - @Override - public void draw(Batch batch, float parentAlpha) { - super.draw(batch, parentAlpha); - } - - @Override - public void onDifferentSong(MusicManager mdp) { - hvisual.setMDP(mdp); - } -}