示例#1
0
        public void DrawFont_NotSetTransform(string fontKey, Vector3 position, string text, Color color)
        {
            if (string.IsNullOrEmpty(text))
            {
                return;
            }

            D3D9.Font d3dFont = fonts[fontKey];

            if (d3dFont != null)
            {
                d3dFont.DrawText(d3d9Sprite, text, (int)position.X, (int)position.Y, color);
            }
        }
示例#2
0
        public void CreateFont(string key, string faceName, int size, bool isItalic)
        {
            lock (locker)
            {
                if (fonts.ContainsKey(key) == false)
                {
                    D3D9.Font d3dFont = new D3D9.Font(d3d9Device,
                                                      size,
                                                      0,
                                                      D3D9.FontWeight.Normal,
                                                      0,
                                                      isItalic,
                                                      D3D9.FontCharacterSet.Hangul,
                                                      D3D9.FontPrecision.Default,
                                                      D3D9.FontQuality.Default,
                                                      D3D9.FontPitchAndFamily.Default,
                                                      faceName);

                    fonts.Add(key, d3dFont);
                }
            }
        }