2017-02-10 13:16:23 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using OpenTK;
|
2017-02-12 15:19:52 +08:00
|
|
|
|
using OpenTK.Graphics;
|
2017-02-10 13:16:23 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
|
using osu.Framework.Graphics.Transformations;
|
2017-02-12 15:19:52 +08:00
|
|
|
|
using osu.Game.Graphics;
|
2017-02-10 13:16:23 +08:00
|
|
|
|
|
2017-02-10 15:10:24 +08:00
|
|
|
|
namespace osu.Game.Modes.Osu.Objects.Drawables.Connections
|
2017-02-10 13:16:23 +08:00
|
|
|
|
{
|
|
|
|
|
public class FollowPoint : Container
|
|
|
|
|
{
|
|
|
|
|
public double StartTime;
|
|
|
|
|
public double EndTime;
|
|
|
|
|
public Vector2 EndPosition;
|
|
|
|
|
|
2017-02-12 15:19:52 +08:00
|
|
|
|
const float width = 8;
|
|
|
|
|
|
2017-02-10 13:16:23 +08:00
|
|
|
|
public FollowPoint()
|
|
|
|
|
{
|
|
|
|
|
Origin = Anchor.Centre;
|
|
|
|
|
Alpha = 0;
|
|
|
|
|
|
2017-02-12 15:19:52 +08:00
|
|
|
|
Masking = true;
|
|
|
|
|
AutoSizeAxes = Axes.Both;
|
|
|
|
|
CornerRadius = width / 2;
|
|
|
|
|
EdgeEffect = new EdgeEffect
|
|
|
|
|
{
|
|
|
|
|
Type = EdgeEffectType.Glow,
|
|
|
|
|
Colour = Color4.White.Opacity(0.2f),
|
|
|
|
|
Radius = 4,
|
|
|
|
|
};
|
|
|
|
|
|
2017-02-10 13:16:23 +08:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2017-02-12 15:19:52 +08:00
|
|
|
|
new Box
|
2017-02-10 13:16:23 +08:00
|
|
|
|
{
|
2017-02-12 15:19:52 +08:00
|
|
|
|
Size = new Vector2(width),
|
2017-02-10 13:16:23 +08:00
|
|
|
|
BlendingMode = BlendingMode.Additive,
|
2017-02-12 15:19:52 +08:00
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Alpha = 0.5f,
|
2017-02-10 13:16:23 +08:00
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
|
{
|
|
|
|
|
base.LoadComplete();
|
|
|
|
|
|
|
|
|
|
Delay(StartTime);
|
|
|
|
|
FadeIn(DrawableOsuHitObject.TIME_FADEIN);
|
|
|
|
|
ScaleTo(1.5f);
|
|
|
|
|
ScaleTo(1, DrawableOsuHitObject.TIME_FADEIN, EasingTypes.Out);
|
|
|
|
|
MoveTo(EndPosition, DrawableOsuHitObject.TIME_FADEIN, EasingTypes.Out);
|
|
|
|
|
|
|
|
|
|
Delay(EndTime - StartTime);
|
|
|
|
|
FadeOut(DrawableOsuHitObject.TIME_FADEIN);
|
|
|
|
|
|
|
|
|
|
Delay(DrawableOsuHitObject.TIME_FADEIN);
|
|
|
|
|
Expire(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|