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

Update transforms.

This commit is contained in:
Huo Yaoyuan 2017-06-16 16:13:23 +08:00
parent bd49ae622a
commit 43569d69a7
2 changed files with 27 additions and 8 deletions

View File

@ -16,13 +16,7 @@ namespace osu.Desktop.VisualTests.Tests
public override void Reset()
{
base.Reset();
var profile = new UserProfileOverlay
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Horizontal = 50 },
};
var profile = new UserProfileOverlay();
Add(profile);
AddStep("Show ppy", () => profile.ShowUser(new User

View File

@ -5,6 +5,7 @@ using System.Linq;
using OpenTK;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics;
@ -17,13 +18,21 @@ using osu.Game.Users.Profile;
namespace osu.Game.Overlays
{
public class UserProfileOverlay : WaveOverlayContainer
public class UserProfileOverlay : FocusedOverlayContainer
{
private ProfileSection lastSection;
private GetUserRequest userReq;
private APIAccess api;
public const float CONTENT_X_MARGIN = 50;
private const float transition_length = 500;
public UserProfileOverlay()
{
RelativeSizeAxes = Axes.Both;
RelativePositionAxes = Axes.Both;
Padding = new MarginPadding { Horizontal = 50 };
}
[BackgroundDependencyLoader]
private void load(APIAccess api)
@ -115,6 +124,22 @@ namespace osu.Game.Overlays
Show();
}
protected override void PopIn()
{
MoveToY(0, transition_length, EasingTypes.OutQuint);
FadeIn(transition_length, EasingTypes.OutQuint);
base.PopIn();
}
protected override void PopOut()
{
MoveToY(Height, transition_length, EasingTypes.OutQuint);
FadeOut(transition_length, EasingTypes.OutQuint);
base.PopOut();
}
private class ProfileTabControl : PageTabControl<ProfileSection>
{
private readonly Box bottom;