Relative size and position for text layer.

This commit is contained in:
Huo Yaoyuan 2016-09-26 16:56:39 +08:00
parent bb13da2b32
commit 25fecfca06

View File

@ -80,6 +80,7 @@ namespace osu.Game.Graphics.UserInterface
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
SizeMode = InheritMode.XY,
Children = new Drawable[] Children = new Drawable[]
{ {
new SpriteText new SpriteText
@ -87,7 +88,8 @@ namespace osu.Game.Graphics.UserInterface
Text = Name, Text = Name,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Position = new Vector2(0, -buttonSprite.Height / 4), PositionMode = InheritMode.XY,
Position = new Vector2(0, -0.25f),
Colour = KeyUpTextColor Colour = KeyUpTextColor
}, },
countSpriteText = new SpriteText countSpriteText = new SpriteText
@ -95,7 +97,8 @@ namespace osu.Game.Graphics.UserInterface
Text = Count.ToString(@"#,0"), Text = Count.ToString(@"#,0"),
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Position = new Vector2(0, buttonSprite.Height / 4), PositionMode = InheritMode.XY,
Position = new Vector2(0, 0.25f),
Colour = KeyUpTextColor Colour = KeyUpTextColor
} }
} }