mirror of
https://github.com/osukey/osukey.git
synced 2025-05-31 02:17:34 +09:00
Add custom representation of unrenderable unicode characters.
This commit is contained in:
parent
a953f22de6
commit
e720bed9e5
@ -1,7 +1,11 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.MathUtils;
|
||||||
|
using OpenTK;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.Sprites
|
namespace osu.Game.Graphics.Sprites
|
||||||
{
|
{
|
||||||
@ -14,5 +18,26 @@ namespace osu.Game.Graphics.Sprites
|
|||||||
Shadow = true;
|
Shadow = true;
|
||||||
TextSize = FONT_SIZE;
|
TextSize = FONT_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override Drawable GetUndrawableCharacter()
|
||||||
|
{
|
||||||
|
var tex = GetTextureForCharacter('?');
|
||||||
|
|
||||||
|
if (tex != null)
|
||||||
|
{
|
||||||
|
float adjust = (RNG.NextSingle() - 0.5f) * 2;
|
||||||
|
return new Sprite
|
||||||
|
{
|
||||||
|
Texture = tex,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Scale = new Vector2(1 + adjust * 0.2f),
|
||||||
|
Rotation = adjust * 15,
|
||||||
|
Colour = Color4.White,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return base.GetUndrawableCharacter();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user