Esempio n. 1
0
        protected override void DrawSelf(SpriteBatch batch)
        {
            base.DrawSelf(batch);

            FrameCount++;

            if (Active && (FrameCount %= 40) <= 20)
            {
                Vector2 position = InnerDimensions.Position;
                string  str      = Cursor > Text.Length ? Text : Text.Substring(0, Cursor);
                Vector2 vec      = (IsLarge ? Main.Xiq12 : Main.Xiq12).MeasureString(str) * TextScale;

                if (IsLarge)
                {
                    position.Y -= 6f * TextScale;
                }
                else
                {
                    position.Y += 6f * TextScale;
                }

                position.X += (InnerDimensions.Width - TextSize.X) * 0.5f + vec.X - (IsLarge ? 8f : 4f) * TextScale + 6f;

                if (IsLarge)
                {
                    batch.DrawBorderedString(Main.Xiq12, "|", position, TextColor, TextScale);
                    return;
                }

                batch.DrawBorderedString(Main.Xiq12, "|", position, TextColor, TextScale);
            }

            Active = false;
        }
Esempio n. 2
0
        protected override void DrawSelf(SpriteBatch batch)
        {
            base.DrawSelf(batch);

            Vector2 position = InnerDimensions.Position;

            position.X += (InnerDimensions.Width - TextSize.X) * TextScale * 0.5f;
            position.Y -= (InnerDimensions.Height - TextSize.Y);

            if (IsLarge)
            {
                batch.DrawBorderedString(Main.Xiq12, Text.ToString(), position, TextColor, TextScale);
                return;
            }

            batch.DrawBorderedString(Main.Xiq12, Text.ToString(), position, TextColor, TextScale);
        }
Esempio n. 3
0
        internal static void Draw(SpriteBatch batch)
        {
            string  avg     = Math.Floor(FPS).ToString();
            Vector2 measure = Main.Xiq12.MeasureString(avg) * 0.4f;
            Vector2 pos     = new Vector2(Main.ScreenRect.Width - measure.X, 0f);

            batch.DrawBorderedString(Main.Xiq12, avg, pos, Color.White, 0.4f);

            CurrentFrames++;
            TotalFrames++;
        }