draw buttons above logo pulse ripples
This commit is contained in:
parent
f8d5106fea
commit
8ef1316b1f
|
@ -304,7 +304,7 @@ public class MainMenu extends BaseOpsuState {
|
||||||
// draw downloads button
|
// draw downloads button
|
||||||
downloadsButton.draw();
|
downloadsButton.draw();
|
||||||
|
|
||||||
// scale stuff for logo
|
// calculate scale stuff for logo
|
||||||
final float clickScale = this.logoClickScale.getValue();
|
final float clickScale = this.logoClickScale.getValue();
|
||||||
Float beatPosition = MusicController.getBeatProgress();
|
Float beatPosition = MusicController.getBeatProgress();
|
||||||
Float beatLength = MusicController.getBeatLength();
|
Float beatLength = MusicController.getBeatLength();
|
||||||
|
@ -327,6 +327,21 @@ public class MainMenu extends BaseOpsuState {
|
||||||
final float logoScale = (0.9726f + smoothExpandProgress * 0.0274f) * clickScale;
|
final float logoScale = (0.9726f + smoothExpandProgress * 0.0274f) * clickScale;
|
||||||
final float totalLogoScale = hoverScale * logoScale;
|
final float totalLogoScale = hoverScale * logoScale;
|
||||||
|
|
||||||
|
// pulse ripples
|
||||||
|
final Color logoColor;
|
||||||
|
if (OPTION_COLOR_MAIN_MENU_LOGO.state) {
|
||||||
|
logoColor = Cursor.lastCursorColor;
|
||||||
|
} else {
|
||||||
|
logoColor = Color.white;
|
||||||
|
}
|
||||||
|
for (PulseData pd : this.pulseData) {
|
||||||
|
final float progress = OUT_CUBIC.calc(pd.position / 1000f);
|
||||||
|
final float scale = (pd.initialScale + (0.432f * progress)) * clickScale;
|
||||||
|
final Image p = MENU_LOGO_PULSE.getScaledImage(scale);
|
||||||
|
p.setAlpha(0.15f * (1f - IN_QUAD.calc(progress)));
|
||||||
|
p.drawCentered(logo.getX(), logo.getY(), logoColor);
|
||||||
|
}
|
||||||
|
|
||||||
// draw buttons
|
// draw buttons
|
||||||
final float buttonProgress = this.buttonsAnimation.getValue();
|
final float buttonProgress = this.buttonsAnimation.getValue();
|
||||||
if (this.logoState != LogoState.DEFAULT && buttonProgress > 0f) {
|
if (this.logoState != LogoState.DEFAULT && buttonProgress > 0f) {
|
||||||
|
@ -355,25 +370,17 @@ public class MainMenu extends BaseOpsuState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw logo (pulsing)
|
// draw logo
|
||||||
Color color = OPTION_COLOR_MAIN_MENU_LOGO.state ? Cursor.lastCursorColor : Color.white;
|
logo.draw(logoColor, logoScale);
|
||||||
for (PulseData pd : this.pulseData) {
|
|
||||||
final float progress = OUT_CUBIC.calc(pd.position / 1000f);
|
|
||||||
final float scale = (pd.initialScale + (0.432f * progress)) * clickScale;
|
|
||||||
final Image p = MENU_LOGO_PULSE.getScaledImage(scale);
|
|
||||||
p.setAlpha(0.15f * (1f - IN_QUAD.calc(progress)));
|
|
||||||
p.drawCentered(logo.getX(), logo.getY(), color);
|
|
||||||
}
|
|
||||||
logo.draw(color, logoScale);
|
|
||||||
if (renderPiece) {
|
if (renderPiece) {
|
||||||
final Image piece = MENU_LOGO_PIECE.getScaledImage(hoverScale * clickScale);
|
final Image piece = MENU_LOGO_PIECE.getScaledImage(hoverScale * clickScale);
|
||||||
piece.rotate(beatPosition * 360f);
|
piece.rotate(beatPosition * 360f);
|
||||||
piece.drawCentered(logo.getX(), logo.getY(), color);
|
piece.drawCentered(logo.getX(), logo.getY(), logoColor);
|
||||||
}
|
}
|
||||||
final float ghostScale = hoverScale * 1.0186f - smoothExpandProgress * 0.0186f;
|
final float ghostScale = hoverScale * 1.0186f - smoothExpandProgress * 0.0186f;
|
||||||
Image ghostLogo = MENU_LOGO.getScaledImage(ghostScale * clickScale);
|
Image ghostLogo = MENU_LOGO.getScaledImage(ghostScale * clickScale);
|
||||||
ghostLogo.setAlpha(0.25f);
|
ghostLogo.setAlpha(0.25f);
|
||||||
ghostLogo.drawCentered(logo.getX(), logo.getY(), color);
|
ghostLogo.drawCentered(logo.getX(), logo.getY(), logoColor);
|
||||||
|
|
||||||
// now playing
|
// now playing
|
||||||
final Image np = GameImage.MUSIC_NOWPLAYING.getImage();
|
final Image np = GameImage.MUSIC_NOWPLAYING.getImage();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user