draw the logo in the bottom right corner of the songmenu

This commit is contained in:
yugecin 2016-12-10 20:36:34 +01:00
parent 22d3ee1b32
commit 8c172dc15f
3 changed files with 26 additions and 4 deletions

View File

@ -126,8 +126,6 @@ public class MainMenu extends BasicGameState {
private Input input; private Input input;
private final int state; private final int state;
private final Color logoGhostColor = new Color(1.0f, 1.0f, 1.0f, 0.15f);
public MainMenu(int state) { public MainMenu(int state) {
this.state = state; this.state = state;
} }
@ -286,7 +284,7 @@ public class MainMenu extends BasicGameState {
Image logoCopy = GameImage.MENU_LOGO.getImage().getScaledCopy(logo.getCurrentScale() / (float) scale * 1.05f); Image logoCopy = GameImage.MENU_LOGO.getImage().getScaledCopy(logo.getCurrentScale() / (float) scale * 1.05f);
scaleposmodx = logoCopy.getWidth() / 2; scaleposmodx = logoCopy.getWidth() / 2;
scaleposmody = logoCopy.getHeight() / 2; scaleposmody = logoCopy.getHeight() / 2;
logoCopy.draw(logo.getX() - scaleposmodx, logo.getY() - scaleposmody, logoGhostColor); logoCopy.draw(logo.getX() - scaleposmodx, logo.getY() - scaleposmody, Colors.GHOST_LOGO);
} else { } else {
logo.draw(); logo.draw();
} }

View File

@ -259,6 +259,9 @@ public class SongMenu extends BasicGameState {
/** Header and footer end and start y coordinates, respectively. */ /** Header and footer end and start y coordinates, respectively. */
private float headerY, footerY; private float headerY, footerY;
/** Height of the footer */
private float footerHeight;
/** Time, in milliseconds, for fading the search bar. */ /** Time, in milliseconds, for fading the search bar. */
private int searchTransitionTimer = SEARCH_TRANSITION_TIME; private int searchTransitionTimer = SEARCH_TRANSITION_TIME;
@ -334,6 +337,7 @@ public class SongMenu extends BasicGameState {
Fonts.BOLD.getLineHeight() + Fonts.DEFAULT.getLineHeight() + Fonts.BOLD.getLineHeight() + Fonts.DEFAULT.getLineHeight() +
Fonts.SMALL.getLineHeight(); Fonts.SMALL.getLineHeight();
footerY = height - GameImage.SELECTION_MODS.getImage().getHeight(); footerY = height - GameImage.SELECTION_MODS.getImage().getHeight();
footerHeight = height - footerY;
// initialize sorts // initialize sorts
for (BeatmapSortOrder sort : BeatmapSortOrder.values()) for (BeatmapSortOrder sort : BeatmapSortOrder.values())
@ -506,6 +510,24 @@ public class SongMenu extends BasicGameState {
g.drawLine(0, footerY, width, footerY); g.drawLine(0, footerY, width, footerY);
g.resetLineWidth(); g.resetLineWidth();
// opsu logo in bottom bar
Image logo = GameImage.MENU_LOGO.getImage();
float logoSize = footerHeight * 2f;
logo = logo.getScaledCopy(logoSize / logo.getWidth());
Double position = MusicController.getBeatProgress();
float x = width - footerHeight * 0.60f;
float y = height - footerHeight * 0.40f;
if (position != null) {
Image ghostLogo = logo.getScaledCopy((float) (1 - (0 - position) * 0.075));
logo = logo.getScaledCopy((float) (1 - (position) * 0.075));
logoSize = logo.getWidth();
logo.draw(x - logoSize / 2, y - logoSize / 2);
logoSize = ghostLogo.getWidth();
ghostLogo.draw(x - logoSize / 2, y - logoSize / 2, Colors.GHOST_LOGO);
} else {
logo.draw(x - logoSize / 2, y - logoSize / 2);
}
// header // header
if (focusNode != null) { if (focusNode != null) {
// music/loader icon // music/loader icon

View File

@ -45,7 +45,9 @@ public class Colors {
BLUE_SCOREBOARD = new Color(133, 208, 212), BLUE_SCOREBOARD = new Color(133, 208, 212),
BLACK_BG_NORMAL = new Color(0, 0, 0, 0.25f), BLACK_BG_NORMAL = new Color(0, 0, 0, 0.25f),
BLACK_BG_HOVER = new Color(0, 0, 0, 0.5f), BLACK_BG_HOVER = new Color(0, 0, 0, 0.5f),
BLACK_BG_FOCUS = new Color(0, 0, 0, 0.75f); BLACK_BG_FOCUS = new Color(0, 0, 0, 0.75f),
GHOST_LOGO = new Color(1.0f, 1.0f, 1.0f, 0.15f);
// This class should not be instantiated. // This class should not be instantiated.
private Colors() {} private Colors() {}