Skip to content

Commit

Permalink
Merge branch 'celeste/main' into fuji/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
hacktic-dev committed Feb 6, 2024
2 parents a84a35d + 434d7ff commit c6b4d63
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Source/Helpers/Menu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,18 +274,17 @@ private void RenderItems(Batcher batch)
var font = Language.Current.SpriteFont;
var size = Size;
var position = Vec2.Zero;
batch.PushMatrix(-size / 2);
batch.PushMatrix(new Vec2(0, -size.Y / 2));

if(!string.IsNullOrEmpty(Title))
{
var at = position + new Vec2(size.X / 2, 0);
var text = Title;
var justify = new Vec2(0.5f, 0);
var color = new Color(8421504);

batch.PushMatrix(
Matrix3x2.CreateScale(TitleScale) *
Matrix3x2.CreateTranslation(at));
Matrix3x2.CreateTranslation(position));
UI.Text(batch, text, Vec2.Zero, justify, color);
batch.PopMatrix();

Expand All @@ -301,12 +300,11 @@ private void RenderItems(Batcher batch)
continue;
}

var at = position + new Vec2(size.X / 2, 0);
var text = items[i].Label;
var justify = new Vec2(0.5f, 0);
var color = Index == i && Focused ? (Time.BetweenInterval(0.1f) ? 0x84FF54 : 0xFCFF59) : Color.White;

UI.Text(batch, text, at, justify, color);
UI.Text(batch, text, position, justify, color);

position.Y += font.LineHeight;
position.Y += Spacing;
Expand Down

0 comments on commit c6b4d63

Please sign in to comment.