diff --git a/core/src/zero1hd/rhythmbullet/audio/visualizer/HorizontalVisualizer.java b/core/src/zero1hd/rhythmbullet/audio/visualizer/HorizontalVisualizer.java index 3d658ca..3a622fe 100755 --- a/core/src/zero1hd/rhythmbullet/audio/visualizer/HorizontalVisualizer.java +++ b/core/src/zero1hd/rhythmbullet/audio/visualizer/HorizontalVisualizer.java @@ -18,18 +18,18 @@ public class HorizontalVisualizer extends VisualizerCore { private int spaceBetweenBars; private int[] barHeights; private int smoothRange; - + private float barHeightMultiplier; public HorizontalVisualizer() { super(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()/2, 0, 0); - + barHeightMultiplier = Gdx.graphics.getHeight()*0.01f; pixmap = new Pixmap(2, 2, Format.RGBA8888); pixmap.setColor(Color.GRAY); pixmap.fill(); bar = new Texture(pixmap); pixmap.dispose(); barCount = 70; - barWidth = MathUtils.ceil(width/barCount); - spaceBetweenBars = 10; + barWidth = MathUtils.ceil((float) width/(float) barCount); + spaceBetweenBars = (barWidth-2); barWidth -= spaceBetweenBars; smoothRange = 4; barHeights = new int[barCount]; @@ -44,7 +44,7 @@ public class HorizontalVisualizer extends VisualizerCore { barHeights[i] += Math.abs(audioPCM[j+i*binsPerBar]); } barHeights[i] /= binsPerBar; - barHeights[i] *= 5; + barHeights[i] *= barHeightMultiplier; } for (int i = 0; i < barCount; i++) { diff --git a/core/src/zero1hd/rhythmbullet/stages/CreativeHUD.java b/core/src/zero1hd/rhythmbullet/stages/CreativeHUD.java index a32eba4..6d8960a 100755 --- a/core/src/zero1hd/rhythmbullet/stages/CreativeHUD.java +++ b/core/src/zero1hd/rhythmbullet/stages/CreativeHUD.java @@ -19,7 +19,7 @@ import zero1hd.rhythmbullet.audio.AudioDataPackage; import zero1hd.rhythmbullet.audio.SongList; import zero1hd.rhythmbullet.audio.map.RhythmMapAlgorithm; import zero1hd.rhythmbullet.screens.MainMenu; -import zero1hd.rhythmbullet.ui.builders.AudioGraph; +import zero1hd.rhythmbullet.ui.components.AudioGraph; import zero1hd.rhythmbullet.ui.windows.BeatViewer; import zero1hd.rhythmbullet.ui.windows.DifficultyWindow; import zero1hd.rhythmbullet.ui.windows.FPSWindow; diff --git a/core/src/zero1hd/rhythmbullet/stages/GameHUD.java b/core/src/zero1hd/rhythmbullet/stages/GameHUD.java index 3be8489..36c5fdd 100755 --- a/core/src/zero1hd/rhythmbullet/stages/GameHUD.java +++ b/core/src/zero1hd/rhythmbullet/stages/GameHUD.java @@ -19,7 +19,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Skin; import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; import zero1hd.rhythmbullet.RhythmBullet; -import zero1hd.rhythmbullet.ui.builders.HealthBar; +import zero1hd.rhythmbullet.ui.components.HealthBar; import zero1hd.rhythmbullet.ui.windows.FPSWindow; import zero1hd.rhythmbullet.ui.windows.PauseMenu; import zero1hd.rhythmbullet.util.ScoreManager; diff --git a/core/src/zero1hd/rhythmbullet/ui/builders/AudioGraph.java b/core/src/zero1hd/rhythmbullet/ui/components/AudioGraph.java similarity index 95% rename from core/src/zero1hd/rhythmbullet/ui/builders/AudioGraph.java rename to core/src/zero1hd/rhythmbullet/ui/components/AudioGraph.java index b3f0f02..9c29ff8 100755 --- a/core/src/zero1hd/rhythmbullet/ui/builders/AudioGraph.java +++ b/core/src/zero1hd/rhythmbullet/ui/components/AudioGraph.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.builders; +package zero1hd.rhythmbullet.ui.components; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Keys; diff --git a/core/src/zero1hd/rhythmbullet/ui/builders/AudioGraphRelation.java b/core/src/zero1hd/rhythmbullet/ui/components/AudioGraphRelation.java similarity index 95% rename from core/src/zero1hd/rhythmbullet/ui/builders/AudioGraphRelation.java rename to core/src/zero1hd/rhythmbullet/ui/components/AudioGraphRelation.java index 17ce8c4..6f992d5 100755 --- a/core/src/zero1hd/rhythmbullet/ui/builders/AudioGraphRelation.java +++ b/core/src/zero1hd/rhythmbullet/ui/components/AudioGraphRelation.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.builders; +package zero1hd.rhythmbullet.ui.components; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Keys; diff --git a/core/src/zero1hd/rhythmbullet/ui/builders/GraphicsTable.java b/core/src/zero1hd/rhythmbullet/ui/components/GraphicsTable.java similarity index 98% rename from core/src/zero1hd/rhythmbullet/ui/builders/GraphicsTable.java rename to core/src/zero1hd/rhythmbullet/ui/components/GraphicsTable.java index 70e1e03..49494ba 100755 --- a/core/src/zero1hd/rhythmbullet/ui/builders/GraphicsTable.java +++ b/core/src/zero1hd/rhythmbullet/ui/components/GraphicsTable.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.builders; +package zero1hd.rhythmbullet.ui.components; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Preferences; diff --git a/core/src/zero1hd/rhythmbullet/ui/builders/HealthBar.java b/core/src/zero1hd/rhythmbullet/ui/components/HealthBar.java similarity index 92% rename from core/src/zero1hd/rhythmbullet/ui/builders/HealthBar.java rename to core/src/zero1hd/rhythmbullet/ui/components/HealthBar.java index f5938e7..100f619 100755 --- a/core/src/zero1hd/rhythmbullet/ui/builders/HealthBar.java +++ b/core/src/zero1hd/rhythmbullet/ui/components/HealthBar.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.builders; +package zero1hd.rhythmbullet.ui.components; import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.scenes.scene2d.actions.Actions; diff --git a/core/src/zero1hd/rhythmbullet/ui/builders/KeySetter.java b/core/src/zero1hd/rhythmbullet/ui/components/KeySetter.java similarity index 97% rename from core/src/zero1hd/rhythmbullet/ui/builders/KeySetter.java rename to core/src/zero1hd/rhythmbullet/ui/components/KeySetter.java index 89db951..69b1ee3 100755 --- a/core/src/zero1hd/rhythmbullet/ui/builders/KeySetter.java +++ b/core/src/zero1hd/rhythmbullet/ui/components/KeySetter.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.builders; +package zero1hd.rhythmbullet.ui.components; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Keys; diff --git a/core/src/zero1hd/rhythmbullet/ui/builders/MusicSelectable.java b/core/src/zero1hd/rhythmbullet/ui/components/MusicSelectable.java similarity index 98% rename from core/src/zero1hd/rhythmbullet/ui/builders/MusicSelectable.java rename to core/src/zero1hd/rhythmbullet/ui/components/MusicSelectable.java index e2b1ce4..7541bb3 100755 --- a/core/src/zero1hd/rhythmbullet/ui/builders/MusicSelectable.java +++ b/core/src/zero1hd/rhythmbullet/ui/components/MusicSelectable.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.builders; +package zero1hd.rhythmbullet.ui.components; import com.badlogic.gdx.Preferences; import com.badlogic.gdx.files.FileHandle; diff --git a/core/src/zero1hd/rhythmbullet/ui/builders/ScrollText.java b/core/src/zero1hd/rhythmbullet/ui/components/ScrollText.java similarity index 94% rename from core/src/zero1hd/rhythmbullet/ui/builders/ScrollText.java rename to core/src/zero1hd/rhythmbullet/ui/components/ScrollText.java index 9962575..2a30c50 100755 --- a/core/src/zero1hd/rhythmbullet/ui/builders/ScrollText.java +++ b/core/src/zero1hd/rhythmbullet/ui/components/ScrollText.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.builders; +package zero1hd.rhythmbullet.ui.components; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.g2d.Batch; diff --git a/core/src/zero1hd/rhythmbullet/ui/builders/SetControls.java b/core/src/zero1hd/rhythmbullet/ui/components/SetControls.java similarity index 98% rename from core/src/zero1hd/rhythmbullet/ui/builders/SetControls.java rename to core/src/zero1hd/rhythmbullet/ui/components/SetControls.java index 1d6751f..932b2cc 100755 --- a/core/src/zero1hd/rhythmbullet/ui/builders/SetControls.java +++ b/core/src/zero1hd/rhythmbullet/ui/components/SetControls.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.builders; +package zero1hd.rhythmbullet.ui.components; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.scenes.scene2d.Actor; diff --git a/core/src/zero1hd/rhythmbullet/ui/builders/SetResolutionButton.java b/core/src/zero1hd/rhythmbullet/ui/components/SetResolutionButton.java similarity index 92% rename from core/src/zero1hd/rhythmbullet/ui/builders/SetResolutionButton.java rename to core/src/zero1hd/rhythmbullet/ui/components/SetResolutionButton.java index 467b02a..436f05b 100755 --- a/core/src/zero1hd/rhythmbullet/ui/builders/SetResolutionButton.java +++ b/core/src/zero1hd/rhythmbullet/ui/components/SetResolutionButton.java @@ -1,4 +1,4 @@ -package zero1hd.rhythmbullet.ui.builders; +package zero1hd.rhythmbullet.ui.components; import java.awt.Dimension; import java.awt.Toolkit; diff --git a/core/src/zero1hd/rhythmbullet/ui/components/Visualizer.java b/core/src/zero1hd/rhythmbullet/ui/components/Visualizer.java new file mode 100644 index 0000000..b7735af --- /dev/null +++ b/core/src/zero1hd/rhythmbullet/ui/components/Visualizer.java @@ -0,0 +1,13 @@ +package zero1hd.rhythmbullet.ui.components; + +import com.badlogic.gdx.scenes.scene2d.Actor; + +import zero1hd.rhythmbullet.audio.visualizer.HorizontalVisualizer; + +public class Visualizer extends Actor { + private HorizontalVisualizer hVis; + + public Visualizer() { + hVis = new HorizontalVisualizer(); + } +} diff --git a/core/src/zero1hd/rhythmbullet/ui/pages/AnalyzePage.java b/core/src/zero1hd/rhythmbullet/ui/pages/AnalyzePage.java index df08f64..e2c3e7b 100755 --- a/core/src/zero1hd/rhythmbullet/ui/pages/AnalyzePage.java +++ b/core/src/zero1hd/rhythmbullet/ui/pages/AnalyzePage.java @@ -24,7 +24,7 @@ import zero1hd.rhythmbullet.audio.SongInfo; import zero1hd.rhythmbullet.audio.map.GamePlayMap; import zero1hd.rhythmbullet.audio.map.RhythmMapAlgorithm; import zero1hd.rhythmbullet.screens.GameScreen; -import zero1hd.rhythmbullet.ui.builders.ScrollText; +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/MainPage.java b/core/src/zero1hd/rhythmbullet/ui/pages/MainPage.java index d98f053..07c378d 100755 --- a/core/src/zero1hd/rhythmbullet/ui/pages/MainPage.java +++ b/core/src/zero1hd/rhythmbullet/ui/pages/MainPage.java @@ -33,6 +33,7 @@ public class MainPage extends Page implements OnDifferentSongListener { private SongController sc; private HorizontalVisualizer hvisual; + public MainPage(RhythmBullet core, Vector3 targetPosition, SongController sc) { hvisual = new HorizontalVisualizer(); this.sc = sc; diff --git a/core/src/zero1hd/rhythmbullet/ui/pages/MoreOptionsPage.java b/core/src/zero1hd/rhythmbullet/ui/pages/MoreOptionsPage.java index faef386..97e7cfc 100755 --- a/core/src/zero1hd/rhythmbullet/ui/pages/MoreOptionsPage.java +++ b/core/src/zero1hd/rhythmbullet/ui/pages/MoreOptionsPage.java @@ -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.builders.GraphicsTable; -import zero1hd.rhythmbullet.ui.builders.SetControls; +import zero1hd.rhythmbullet.ui.components.GraphicsTable; +import zero1hd.rhythmbullet.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/ui/pages/MusicSelectionPage.java index acc67a5..a104b4e 100755 --- a/core/src/zero1hd/rhythmbullet/ui/pages/MusicSelectionPage.java +++ b/core/src/zero1hd/rhythmbullet/ui/pages/MusicSelectionPage.java @@ -18,7 +18,7 @@ import com.badlogic.gdx.utils.Array; import zero1hd.rhythmbullet.audio.SongInfo; import zero1hd.rhythmbullet.audio.SongList; -import zero1hd.rhythmbullet.ui.builders.MusicSelectable; +import zero1hd.rhythmbullet.ui.components.MusicSelectable; import zero1hd.rhythmbullet.util.MiniEvents; public class MusicSelectionPage extends Page {