1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 03:22:54 +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())) if (!OsuGameBase.VIDEO_EXTENSIONS.Contains(Path.GetExtension(path).ToLowerInvariant()))
break; break;
storyboard.GetLayer("Video").Add(new StoryboardVideo(path, offset)); storyboard.GetLayer("Video").Add(storyboardSprite = new StoryboardVideo(path, offset));
break; break;
} }

View File

@ -3,23 +3,18 @@
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Storyboards.Drawables; using osu.Game.Storyboards.Drawables;
using osuTK;
namespace osu.Game.Storyboards 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) public StoryboardVideo(string path, double offset)
: base(path, Anchor.Centre, Vector2.Zero)
{ {
Path = path; TimelineGroup.Alpha.Add(Easing.None, offset, offset, 0, 1);
StartTime = offset;
} }
public Drawable CreateDrawable() => new DrawableStoryboardVideo(this); public override Drawable CreateDrawable() => new DrawableStoryboardVideo(this);
} }
} }