public FontInstance Clone() { FontInstance font = new FontInstance(Engine); font._atlas = new TextureAtlas(_atlas.Size); font._glyphs = new Image[_glyphs.Length]; for (var i = 0; i < _glyphs.Length; ++i) font._glyphs[i] = new Image(_glyphs[i]); font._height = _height; font._version = _version; font._updated = true; return font; }
public void DrawText(FontInstance font, int x, int y, string text) { font.DrawText(_batch, x, y, text); _changed = true; }
public void DrawText(FontInstance font, int x, int y, string text) { int color = font.GetColorMask().GetInt(); fixed (byte* buf = _pixels) { for (var i = 0; i < text.Length; ++i) { Image img = font.GetGlyph(text[i]); DrawImageMask(buf, x, y, img.Pixels, (int)img.Size.X, (int)img.Size.Y, color); x += (int)img.Size.X; } } _changed = true; }