예제 #1
0
        private void Load()
        {
            var textSize = SizeConsts.TextSize1;

            Width        = InputWidth;
            Height       = InputHeight;
            AutoSizeAxes = Axes.Both;
            Children     = new Drawable[] {
                NameInput = new() {
                    Size         = new Vector2(InputWidth * 0.75f, InputHeight),
                    BorderColour = Color4.Red,
                    Masking      = true,
                },
                SaveButton = new() {
                    Action = () => LeaderboardContainer.AddEntry(NameInput.Text, Score),
                    Width  = InputWidth * 0.25f,
                    Height = InputHeight,
                    Icon   = FontAwesome.Solid.Save,
                }
            };
            NameInput.OnCommit += (_, _) => SaveButton.Click();  // Pressing enter clicks the button
        }
예제 #2
0
 public AddLeaderboardEntryContainer(LeaderboardContainer leaderboardContainer, double score)
 {
     LeaderboardContainer = leaderboardContainer;
     Score = score;
 }