visualizer design changes

This commit is contained in:
Harrison Deng 2017-09-11 13:25:42 -05:00
parent d257d2df60
commit ca84a4522e
17 changed files with 34 additions and 20 deletions

View File

@ -18,18 +18,18 @@ public class HorizontalVisualizer extends VisualizerCore {
private int spaceBetweenBars; private int spaceBetweenBars;
private int[] barHeights; private int[] barHeights;
private int smoothRange; private int smoothRange;
private float barHeightMultiplier;
public HorizontalVisualizer() { public HorizontalVisualizer() {
super(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()/2, 0, 0); super(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()/2, 0, 0);
barHeightMultiplier = Gdx.graphics.getHeight()*0.01f;
pixmap = new Pixmap(2, 2, Format.RGBA8888); pixmap = new Pixmap(2, 2, Format.RGBA8888);
pixmap.setColor(Color.GRAY); pixmap.setColor(Color.GRAY);
pixmap.fill(); pixmap.fill();
bar = new Texture(pixmap); bar = new Texture(pixmap);
pixmap.dispose(); pixmap.dispose();
barCount = 70; barCount = 70;
barWidth = MathUtils.ceil(width/barCount); barWidth = MathUtils.ceil((float) width/(float) barCount);
spaceBetweenBars = 10; spaceBetweenBars = (barWidth-2);
barWidth -= spaceBetweenBars; barWidth -= spaceBetweenBars;
smoothRange = 4; smoothRange = 4;
barHeights = new int[barCount]; barHeights = new int[barCount];
@ -44,7 +44,7 @@ public class HorizontalVisualizer extends VisualizerCore {
barHeights[i] += Math.abs(audioPCM[j+i*binsPerBar]); barHeights[i] += Math.abs(audioPCM[j+i*binsPerBar]);
} }
barHeights[i] /= binsPerBar; barHeights[i] /= binsPerBar;
barHeights[i] *= 5; barHeights[i] *= barHeightMultiplier;
} }
for (int i = 0; i < barCount; i++) { for (int i = 0; i < barCount; i++) {

View File

@ -19,7 +19,7 @@ import zero1hd.rhythmbullet.audio.AudioDataPackage;
import zero1hd.rhythmbullet.audio.SongList; import zero1hd.rhythmbullet.audio.SongList;
import zero1hd.rhythmbullet.audio.map.RhythmMapAlgorithm; import zero1hd.rhythmbullet.audio.map.RhythmMapAlgorithm;
import zero1hd.rhythmbullet.screens.MainMenu; 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.BeatViewer;
import zero1hd.rhythmbullet.ui.windows.DifficultyWindow; import zero1hd.rhythmbullet.ui.windows.DifficultyWindow;
import zero1hd.rhythmbullet.ui.windows.FPSWindow; import zero1hd.rhythmbullet.ui.windows.FPSWindow;

View File

@ -19,7 +19,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
import zero1hd.rhythmbullet.RhythmBullet; 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.FPSWindow;
import zero1hd.rhythmbullet.ui.windows.PauseMenu; import zero1hd.rhythmbullet.ui.windows.PauseMenu;
import zero1hd.rhythmbullet.util.ScoreManager; import zero1hd.rhythmbullet.util.ScoreManager;

View File

@ -1,4 +1,4 @@
package zero1hd.rhythmbullet.ui.builders; package zero1hd.rhythmbullet.ui.components;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input.Keys; import com.badlogic.gdx.Input.Keys;

View File

@ -1,4 +1,4 @@
package zero1hd.rhythmbullet.ui.builders; package zero1hd.rhythmbullet.ui.components;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input.Keys; import com.badlogic.gdx.Input.Keys;

View File

@ -1,4 +1,4 @@
package zero1hd.rhythmbullet.ui.builders; package zero1hd.rhythmbullet.ui.components;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Preferences; import com.badlogic.gdx.Preferences;

View File

@ -1,4 +1,4 @@
package zero1hd.rhythmbullet.ui.builders; package zero1hd.rhythmbullet.ui.components;
import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.scenes.scene2d.actions.Actions; import com.badlogic.gdx.scenes.scene2d.actions.Actions;

View File

@ -1,4 +1,4 @@
package zero1hd.rhythmbullet.ui.builders; package zero1hd.rhythmbullet.ui.components;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input.Keys; import com.badlogic.gdx.Input.Keys;

View File

@ -1,4 +1,4 @@
package zero1hd.rhythmbullet.ui.builders; package zero1hd.rhythmbullet.ui.components;
import com.badlogic.gdx.Preferences; import com.badlogic.gdx.Preferences;
import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.files.FileHandle;

View File

@ -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.Color;
import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.Batch;

View File

@ -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.Color;
import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.Actor;

View File

@ -1,4 +1,4 @@
package zero1hd.rhythmbullet.ui.builders; package zero1hd.rhythmbullet.ui.components;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Toolkit; import java.awt.Toolkit;

View File

@ -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();
}
}

View File

@ -24,7 +24,7 @@ import zero1hd.rhythmbullet.audio.SongInfo;
import zero1hd.rhythmbullet.audio.map.GamePlayMap; import zero1hd.rhythmbullet.audio.map.GamePlayMap;
import zero1hd.rhythmbullet.audio.map.RhythmMapAlgorithm; import zero1hd.rhythmbullet.audio.map.RhythmMapAlgorithm;
import zero1hd.rhythmbullet.screens.GameScreen; 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.MiniEvents;
import zero1hd.rhythmbullet.util.MiniListener; import zero1hd.rhythmbullet.util.MiniListener;

View File

@ -33,6 +33,7 @@ public class MainPage extends Page implements OnDifferentSongListener {
private SongController sc; private SongController sc;
private HorizontalVisualizer hvisual; private HorizontalVisualizer hvisual;
public MainPage(RhythmBullet core, Vector3 targetPosition, SongController sc) { public MainPage(RhythmBullet core, Vector3 targetPosition, SongController sc) {
hvisual = new HorizontalVisualizer(); hvisual = new HorizontalVisualizer();
this.sc = sc; this.sc = sc;

View File

@ -9,8 +9,8 @@ import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
import zero1hd.rhythmbullet.RhythmBullet; import zero1hd.rhythmbullet.RhythmBullet;
import zero1hd.rhythmbullet.controls.KeyMap; import zero1hd.rhythmbullet.controls.KeyMap;
import zero1hd.rhythmbullet.ui.builders.GraphicsTable; import zero1hd.rhythmbullet.ui.components.GraphicsTable;
import zero1hd.rhythmbullet.ui.builders.SetControls; import zero1hd.rhythmbullet.ui.components.SetControls;
public class MoreOptionsPage extends Page { public class MoreOptionsPage extends Page {
private KeyMap keymap; private KeyMap keymap;

View File

@ -18,7 +18,7 @@ import com.badlogic.gdx.utils.Array;
import zero1hd.rhythmbullet.audio.SongInfo; import zero1hd.rhythmbullet.audio.SongInfo;
import zero1hd.rhythmbullet.audio.SongList; import zero1hd.rhythmbullet.audio.SongList;
import zero1hd.rhythmbullet.ui.builders.MusicSelectable; import zero1hd.rhythmbullet.ui.components.MusicSelectable;
import zero1hd.rhythmbullet.util.MiniEvents; import zero1hd.rhythmbullet.util.MiniEvents;
public class MusicSelectionPage extends Page { public class MusicSelectionPage extends Page {