1
0
mirror of https://github.com/ppy/osu.git synced 2024-05-14 07:21:19 +08:00

Apply transforms to storyboard videos

This requires that they are a `StoryboardSprite` for simplicity. Luckily
this works just fine.
This commit is contained in:
Dean Herbert 2024-04-22 18:43:15 +08:00
parent 308744348f
commit 4ae9f81c73
No known key found for this signature in database
2 changed files with 6 additions and 11 deletions

View File

@ -114,7 +114,7 @@ namespace osu.Game.Beatmaps.Formats
if (!OsuGameBase.VIDEO_EXTENSIONS.Contains(Path.GetExtension(path).ToLowerInvariant()))
break;
storyboard.GetLayer("Video").Add(new StoryboardVideo(path, offset));
storyboard.GetLayer("Video").Add(storyboardSprite = new StoryboardVideo(path, offset));
break;
}

View File

@ -3,23 +3,18 @@
using osu.Framework.Graphics;
using osu.Game.Storyboards.Drawables;
using osuTK;
namespace osu.Game.Storyboards
{
public class StoryboardVideo : IStoryboardElement
public class StoryboardVideo : StoryboardSprite
{
public string Path { get; }
public bool IsDrawable => true;
public double StartTime { get; }
public StoryboardVideo(string path, double offset)
: base(path, Anchor.Centre, Vector2.Zero)
{
Path = path;
StartTime = offset;
TimelineGroup.Alpha.Add(Easing.None, offset, offset, 0, 1);
}
public Drawable CreateDrawable() => new DrawableStoryboardVideo(this);
public override Drawable CreateDrawable() => new DrawableStoryboardVideo(this);
}
}