Skip to content

Commit

Permalink
use margins isntead of moving the position of the sprite
Browse files Browse the repository at this point in the history
  • Loading branch information
iminlikewithyou committed Dec 30, 2023
1 parent 51d26d2 commit 452f201
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions osu.Game/Screens/Menu/MainMenuButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ public MainMenuButton(LocalisableString text, string sampleName, IconUsage symbo
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(32),
Position = new Vector2(0, -4),
Position = new Vector2(0, 0),
Margin = new MarginPadding { Top = -4 },
Icon = symbol
},
new OsuSpriteText
Expand All @@ -138,7 +139,8 @@ public MainMenuButton(LocalisableString text, string sampleName, IconUsage symbo
AllowMultiline = false,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Position = new Vector2(-3, 35),
Position = new Vector2(0, 35),
Margin = new MarginPadding { Left = -3 },
Text = text
}
}
Expand Down Expand Up @@ -189,7 +191,7 @@ protected override void OnHoverLost(HoverLostEvent e)
{
icon.ClearTransforms();
icon.RotateTo(0, 500, Easing.Out);
icon.MoveTo(new Vector2(0, -4), 500, Easing.Out);
icon.MoveTo(Vector2.Zero, 500, Easing.Out);
icon.ScaleTo(Vector2.One, 200, Easing.Out);

if (State == ButtonState.Expanded)
Expand Down

0 comments on commit 452f201

Please sign in to comment.