mirror of
https://github.com/ppy/osu
synced 2025-01-15 02:21:28 +00: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:
parent
308744348f
commit
4ae9f81c73
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user