1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

Remove need for logo relativePositionAxes none

This commit is contained in:
David Zhao 2019-04-03 20:32:53 +09:00
parent 2ed945605e
commit 8a40b27e8f
4 changed files with 4 additions and 10 deletions

View File

@ -177,7 +177,6 @@ namespace osu.Game.Tests.Visual
Scheduler.AddDelayed(() =>
{
logoFacadeContainer.Tracking = true;
//logo.RelativePositionAxes = Axes.None;
visualBox.Colour = Color4.Tomato;
}, 700);
});

View File

@ -54,7 +54,7 @@ namespace osu.Game.Graphics.Containers
startPosition = null;
}
private Vector2 localSpaceConversion()
private Vector2 logoTrackingPosition()
{
Vector2 local;
local.X = logo.Parent.ToLocalSpace(LogoFacade.ScreenSpaceDrawQuad.Centre).X / logo.Parent.RelativeToAbsoluteFactor.X;
@ -62,8 +62,6 @@ namespace osu.Game.Graphics.Containers
return local;
}
private Vector2 logoTrackingPosition => logo.RelativePositionAxes == Axes.None ? logo.Parent.ToLocalSpace(LogoFacade.ScreenSpaceDrawQuad.Centre) : localSpaceConversion();
protected override void Update()
{
base.Update();
@ -74,7 +72,7 @@ namespace osu.Game.Graphics.Containers
// Account for the scale of the actual logo container, as SizeForFlow only accounts for the sprite scale.
LogoFacade.Size = new Vector2(logo.SizeForFlow * logo.Scale.X * facadeScale);
if (LogoFacade.Parent != null && logo.Position != logoTrackingPosition)
if (LogoFacade.Parent != null && logo.Position != logoTrackingPosition())
{
// If this is our first update since tracking has started, initialize our starting values for interpolation
if (startTime == null || startPosition == null)
@ -90,11 +88,11 @@ namespace osu.Game.Graphics.Containers
var mount = (float)Interpolation.ApplyEasing(easing, Math.Min(elapsedDuration / duration, 1));
// Interpolate the position of the logo, where mount 0 is where the logo was when it first began interpolating, and mount 1 is the target location.
logo.Position = Vector2.Lerp(startPosition ?? throw new ArgumentNullException(nameof(startPosition)), logoTrackingPosition, mount);
logo.Position = Vector2.Lerp(startPosition ?? throw new ArgumentNullException(nameof(startPosition)), logoTrackingPosition(), mount);
}
else
{
logo.Position = logoTrackingPosition;
logo.Position = logoTrackingPosition();
}
}
}

View File

@ -290,7 +290,6 @@ namespace osu.Game.Screens.Menu
break;
case ButtonSystemState.Initial:
logo.ClearTransforms(targetMember: nameof(Position));
logo.RelativePositionAxes = Axes.None;
bool impact = logo.Scale.X > 0.6f;
@ -311,7 +310,6 @@ namespace osu.Game.Screens.Menu
break;
default:
logo.ClearTransforms(targetMember: nameof(Position));
logo.RelativePositionAxes = Axes.None;
logoFacadeContainer.Tracking = true;
logo.ScaleTo(0.5f, 200, Easing.OutQuint);
break;

View File

@ -175,7 +175,6 @@ namespace osu.Game.Screens.Play
Scheduler.AddDelayed(() =>
{
content.Tracking = true;
//logo.RelativePositionAxes = Axes.None;
}, resuming ? 0 : 500);
}