Esempio n. 1
0
        /// <summary>
        /// Draws a string.
        /// </summary>
        /// <param name="text">The Text.</param>
        /// <param name="font">The Font.</param>
        /// <param name="position">The Position.</param>
        /// <param name="color">The Color.</param>
        public void DrawString(string text, IFont font, Vector2 position, Color color)
        {
            var oglFont = font as OpenGLFont;

            if (oglFont == null)
            {
                throw new ArgumentException("Expected a OpenGLFont as resource.");
            }

            OpenGLTexture texture = _textEntityManager.GetFontTexture(text, oglFont, color);

            DrawTexture(texture, position, Color.White);
        }
Esempio n. 2
0
        /// <summary>
        /// Draws a string.
        /// </summary>
        /// <param name="text">The Text.</param>
        /// <param name="font">The Font.</param>
        /// <param name="rectangle">The Rectangle.</param>
        /// <param name="color">The Color.</param>
        public void DrawString(string text, IFont font, Rectangle rectangle, Color color)
        {
            var oglFont = font as OpenGLFont;

            if (oglFont == null)
            {
                throw new ArgumentException("Expected a OpenGLFont as resource.");
            }

            OpenGLTexture texture = _textEntityManager.GetFontTexture(text, oglFont, color, (int)rectangle.Width);

            DrawTexture(texture, new Vector2(rectangle.X, rectangle.Y), Color.White);
        }
Esempio n. 3
0
 /// <summary>
 /// Draws the text.
 /// </summary>
 public void DrawText()
 {
     Texture = new OpenGLTexture(BitmapFont.DrawTextToBitmap(_text, _font, _color));
 }
Esempio n. 4
0
 /// <summary>
 /// Draws the text.
 /// </summary>
 public void DrawText()
 {
     Texture = new OpenGLTexture(BitmapFont.DrawTextToBitmap(_text, _font, _color));
 }