2018-01-05 20:21:19 +09:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-02-07 13:59:30 +09:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
2016-11-24 13:48:48 +09:00
|
|
|
|
|
2017-11-07 23:14:22 +01:00
|
|
|
|
using System;
|
2016-11-24 13:48:48 +09:00
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Beatmaps.Drawables
|
|
|
|
|
{
|
2017-11-21 11:49:42 +09:00
|
|
|
|
public class BeatmapBackgroundSprite : Sprite
|
2016-11-24 13:48:48 +09:00
|
|
|
|
{
|
|
|
|
|
private readonly WorkingBeatmap working;
|
|
|
|
|
|
|
|
|
|
public BeatmapBackgroundSprite(WorkingBeatmap working)
|
|
|
|
|
{
|
2017-11-07 23:14:22 +01:00
|
|
|
|
if (working == null)
|
|
|
|
|
throw new ArgumentNullException(nameof(working));
|
|
|
|
|
|
2016-11-24 13:48:48 +09:00
|
|
|
|
this.working = working;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2017-02-27 17:32:32 +03:00
|
|
|
|
private void load()
|
2016-11-24 13:48:48 +09:00
|
|
|
|
{
|
2017-01-24 16:01:49 +09:00
|
|
|
|
if (working.Background != null)
|
|
|
|
|
Texture = working.Background;
|
2016-11-24 13:48:48 +09:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|