Exemplo n.º 1
0
        public Score(SceneGame world, Vector2 position, int amount, bool big, int time) : base(world)
        {
            Position = position;
            Big      = big;
            Frame    = new Slider(time);
            Text     = new TextBuilder(float.PositiveInfinity, float.PositiveInfinity, new TextFormatting()
            {
                Bold      = Big,
                GetParams = (pos) => new DialogParams()
                {
                    Color  = Color.White,
                    Border = Color.Black,
                    Scale  = Vector2.One,
                }
            }, new DialogFormattingScore(2, new SubSlider(Frame, 0, 20)));
            Text.StartLine(LineAlignment.Center);
            var scoreText = amount.ToString();

            if (!Big)
            {
                scoreText = Game.ConvertToSmallPixelText(scoreText);
            }
            Text.AppendText(scoreText);
            Text.EndLine();
            Text.EndContainer();
            Text.Finish();
            Text.DefaultDialog.Show();
        }
Exemplo n.º 2
0
 public SceneLoading(Game game) : base(game)
 {
     LoadingText = new TextBuilder(float.PositiveInfinity, float.PositiveInfinity);
     LoadingText.StartLine(LineAlignment.Center);
     LoadingText.AppendText("Restarting Game...");
     LoadingText.EndLine();
     LoadingText.EndContainer();
     LoadingText.Finish();
 }
Exemplo n.º 3
0
 public LabelledUI(SpriteReference labelSprite, SpriteReference contentSprite, Action <TextBuilder> label, Func <Point> size)
 {
     ContentSprite = contentSprite;
     LabelSprite   = labelSprite;
     Label         = new TextBuilder(float.PositiveInfinity, 16);
     if (label != null)
     {
         Label.StartLine(LineAlignment.Center);
         label(Label);
         Label.EndLine();
     }
     Label.EndContainer();
     Label.Finish();
     Size = size;
 }