1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-08 09:27:32 +08:00
osu-lazer/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs

44 lines
1.3 KiB
C#
Raw Normal View History

// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2017-02-07 12:52:19 +08:00
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
2017-02-07 12:52:19 +08:00
using OpenTK;
2016-11-23 10:59:50 +08:00
namespace osu.Game.Beatmaps.Drawables
2016-10-27 10:55:55 +08:00
{
public class DifficultyIcon : DifficultyColouredContainer
2017-02-07 12:52:19 +08:00
{
2017-04-24 19:31:25 +08:00
private readonly BeatmapInfo beatmap;
2017-02-07 12:52:19 +08:00
public DifficultyIcon(BeatmapInfo beatmap) : base(beatmap)
2017-02-07 12:52:19 +08:00
{
this.beatmap = beatmap;
Size = new Vector2(20);
2017-02-07 12:52:19 +08:00
}
[BackgroundDependencyLoader]
2017-04-24 19:31:25 +08:00
private void load()
{
Children = new Drawable[]
2017-02-07 12:52:19 +08:00
{
new SpriteIcon
2017-02-07 12:52:19 +08:00
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Colour = AccentColour,
2017-02-07 12:52:19 +08:00
Icon = FontAwesome.fa_circle
},
new ConstrainedIconContainer
2017-02-07 12:52:19 +08:00
{
RelativeSizeAxes = Axes.Both,
Icon = beatmap.Ruleset.CreateInstance().CreateIcon()
2017-02-07 12:52:19 +08:00
}
};
2017-02-07 12:52:19 +08:00
}
2016-10-27 10:55:55 +08:00
}
}