1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-17 15:12:54 +08:00
osu-lazer/osu.Game/Storyboards/Drawables/StoryboardLayer.cs

38 lines
1.1 KiB
C#
Raw Normal View History

2017-09-08 05:55:05 +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 osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Storyboards.Drawables
{
public class StoryboardLayer : Container
{
public LayerDefinition Definition { get; private set; }
public bool Enabled;
public override bool IsPresent => Enabled && base.IsPresent;
public StoryboardLayer(LayerDefinition definition)
{
Definition = definition;
RelativeSizeAxes = Axes.Both;
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
Enabled = definition.EnabledWhenPassing;
}
[BackgroundDependencyLoader]
private void load()
{
foreach (var element in Definition.Elements)
{
var drawable = element.CreateDrawable();
if (drawable != null)
Add(drawable);
}
}
}
}