osu/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs

49 lines
1.4 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 04:52:19 +00:00
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Database;
using osu.Game.Graphics;
using OpenTK;
using OpenTK.Graphics;
2016-11-23 02:59:50 +00:00
namespace osu.Game.Beatmaps.Drawables
2016-10-27 02:55:55 +00:00
{
internal class DifficultyIcon : DifficultyColouredContainer
2017-02-07 04:52:19 +00:00
{
2017-04-24 11:31:25 +00:00
private readonly BeatmapInfo beatmap;
2017-02-07 04:52:19 +00:00
public DifficultyIcon(BeatmapInfo beatmap) : base(beatmap)
2017-02-07 04:52:19 +00:00
{
this.beatmap = beatmap;
Size = new Vector2(20);
2017-02-07 04:52:19 +00:00
}
[BackgroundDependencyLoader]
2017-04-24 11:31:25 +00:00
private void load()
{
Children = new[]
2017-02-07 04:52:19 +00:00
{
new TextAwesome
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
2017-02-07 04:52:19 +00:00
TextSize = Size.X,
Colour = AccentColour,
2017-02-07 04:52:19 +00:00
Icon = FontAwesome.fa_circle
},
new TextAwesome
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
2017-02-07 04:52:19 +00:00
TextSize = Size.X,
Colour = Color4.White,
2017-04-17 08:43:48 +00:00
Icon = beatmap.Ruleset.CreateInstance().Icon
2017-02-07 04:52:19 +00:00
}
};
2017-02-07 04:52:19 +00:00
}
2016-10-27 02:55:55 +00:00
}
}