Allow Rulesets to create a non-FontAwesome icon

This also
- Renames TextAwesome to SpriteIcon.
- Removes the default size of "20" from SpriteIcon (now defaults to the underlying texture size).
This commit is contained in:
Dean Herbert
2017-08-03 14:36:21 +09:00
parent d72a479d9d
commit 0d9ea97828
55 changed files with 317 additions and 187 deletions

View File

@ -4,8 +4,8 @@
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using OpenTK;
using OpenTK.Graphics;
namespace osu.Game.Beatmaps.Drawables
{
@ -22,23 +22,20 @@ namespace osu.Game.Beatmaps.Drawables
[BackgroundDependencyLoader]
private void load()
{
Children = new[]
Children = new Drawable[]
{
new TextAwesome
new SpriteIcon
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
TextSize = Size.X,
RelativeSizeAxes = Axes.Both,
Colour = AccentColour,
Icon = FontAwesome.fa_circle
},
new TextAwesome
new ConstrainedIconContainer
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
TextSize = Size.X,
Colour = Color4.White,
Icon = beatmap.Ruleset.CreateInstance().Icon
RelativeSizeAxes = Axes.Both,
Icon = beatmap.Ruleset.CreateInstance().CreateIcon()
}
};
}