Beispiel #1
0
        public static void DrawString(String pString, float x, float y, ColorName color = ColorName.White)
        {
            Azul.Sprite pAzulSprite = new Azul.Sprite();

            for (int i = 0; i < pString.Length; i++)
            {
                int  key   = Convert.ToByte(pString[i]);
                Font pFont = FontManager.Find(FontName.Consolas36pt, key);
                Debug.Assert(pFont != null);
                pAzulSprite.Swap(pFont.GetAzulTexture(), pFont.GetAzulRect(),
                                 new Azul.Rect(x, y, pFont.GetAzulRect().width, pFont.GetAzulRect().height),
                                 ColorFactory.Create(color).pAzulColor);
                pAzulSprite.Update();
                pAzulSprite.Render();
                x += pFont.GetAzulRect().width;
            }
        }