visualizer design changes
This commit is contained in:
		@@ -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++) {
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
@@ -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;
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
package zero1hd.rhythmbullet.ui.builders;
 | 
			
		||||
package zero1hd.rhythmbullet.ui.components;
 | 
			
		||||
 | 
			
		||||
import com.badlogic.gdx.Gdx;
 | 
			
		||||
import com.badlogic.gdx.Preferences;
 | 
			
		||||
@@ -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;
 | 
			
		||||
@@ -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;
 | 
			
		||||
@@ -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;
 | 
			
		||||
@@ -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;
 | 
			
		||||
@@ -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;
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
package zero1hd.rhythmbullet.ui.builders;
 | 
			
		||||
package zero1hd.rhythmbullet.ui.components;
 | 
			
		||||
 | 
			
		||||
import java.awt.Dimension;
 | 
			
		||||
import java.awt.Toolkit;
 | 
			
		||||
							
								
								
									
										13
									
								
								core/src/zero1hd/rhythmbullet/ui/components/Visualizer.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								core/src/zero1hd/rhythmbullet/ui/components/Visualizer.java
									
									
									
									
									
										Normal 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();
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -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;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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 {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user