Skip to content

Commit 6a9b009

Browse files
committed
Added creator info
1 parent 070e801 commit 6a9b009

4 files changed

Lines changed: 18 additions & 11 deletions

File tree

Content/songs/gameBG.mp3

-1.83 MB
Binary file not shown.

Content/songs/titleBG.mp3

-6.09 MB
Binary file not shown.

Script/UI/TitleUI.cs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ namespace PingPong
88
{
99
public class TitleUI: Grid
1010
{
11-
public Label titleText;
11+
private Label _titleText;
1212
public ImageTextButton initNormalGameBtn;
1313
public ImageTextButton lanUIBtn;
14+
private Label _aboutMe;
1415
public TitleUI()
1516
{
1617
BuildUI();
@@ -24,13 +25,12 @@ private void BuildUI()
2425
FontSystem font = new FontSystem(fontSet);
2526
font.AddFont(ttfData);
2627

27-
titleText = new Label();
28-
titleText.Text = @"\c[indianRed]PING \c[skyBlue]PONG";
29-
titleText.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
30-
titleText.Margin = new Thickness(0, 80, 0, 0);
31-
titleText.Background = new SolidBrush("#00000000");
32-
titleText.Id = "title";
33-
titleText.Font = font.GetFont(128);
28+
_titleText = new Label();
29+
_titleText.Text = @"\c[indianRed]PING \c[skyBlue]PONG";
30+
_titleText.HorizontalAlignment = Myra.Graphics2D.UI.HorizontalAlignment.Center;
31+
_titleText.Margin = new Thickness(0, 80, 0, 0);
32+
_titleText.Background = new SolidBrush("#00000000");
33+
_titleText.Font = font.GetFont(128);
3434

3535
ttfData = File.ReadAllBytes("./Data/fonts/buttons.otf");
3636
fontSet = new FontSystemSettings{Effect = FontSystemEffect.Stroked, EffectAmount = 2};
@@ -43,10 +43,18 @@ private void BuildUI()
4343
lanUIBtn = UI.DefaultTextButton("Lan Game", font);
4444
lanUIBtn.Margin = new Thickness(0, 300, 0, 0);
4545

46+
_aboutMe = new Label();
47+
_aboutMe.Text = @"IG - george_psf";
48+
_aboutMe.VerticalAlignment = VerticalAlignment.Bottom;
49+
_aboutMe.Margin = new Thickness(2, 0, 0, 4);
50+
_aboutMe.Background = new SolidBrush("#00000000");
51+
_aboutMe.Font = font.GetFont(20);
52+
4653

47-
Widgets.Add(titleText);
54+
Widgets.Add(_titleText);
4855
Widgets.Add(initNormalGameBtn);
4956
Widgets.Add(lanUIBtn);
57+
Widgets.Add(_aboutMe);
5058
}
5159
}
5260
}

Script/UI/UI.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using Microsoft.Xna.Framework;
33
using Microsoft.Xna.Framework.Audio;
44
using Microsoft.Xna.Framework.Graphics;
5-
using Microsoft.Xna.Framework.Media;
65
using Myra;
76
using Myra.Graphics2D.TextureAtlases;
87
using Myra.Graphics2D.UI;
@@ -18,7 +17,7 @@ public static ImageTextButton DefaultTextButton(string txt, FontSystem font)
1817
DefaultTextButton.Text = txt;
1918
DefaultTextButton.TextPosition = ImageTextButton.TextPositionEnum.OverlapsImage;
2019
DefaultTextButton.LabelHorizontalAlignment = HorizontalAlignment.Center;
21-
DefaultTextButton.LabelVerticalAlignment = VerticalAlignment.Center;
20+
DefaultTextButton.LabelVerticalAlignment = VerticalAlignment.Top;
2221

2322
DefaultTextButton.Image = new TextureRegion(MyraEnvironment.Game.Content.Load<Texture2D>("UI/button/Normal"));
2423
DefaultTextButton.OverImage = new TextureRegion(MyraEnvironment.Game.Content.Load<Texture2D>("UI/button/Overed"));

0 commit comments

Comments
 (0)