public Font GetFont(string fontname, Action <Font> loadedCB = null) { FontImpl font = new FontImpl(mgr, fontname); if (loadedCB != null) { loadedCB(font); } return(font); }
public void DrawText(Font font, string text, WWUtils.Math.Vector2 <float> position, WWUtils.Math.Vector2 <float> Handle, float rotation, WWUtils.Math.Vector2 <float> scale, WWUtils.Math.Vector3 <byte> color) { FontImpl fnt = font as FontImpl; mgr.PushState(); mgr.SetFont(fnt.Name); mgr.SetFillColor(color.X, color.Y, color.Z); mgr.Translate((int)-Handle.X, (int)-Handle.Y); mgr.Rotate(rotation); mgr.Scale(scale.X, scale.Y); // need to add text height because CanvasManager palces baseline at origin mgr.FillText(text, (int)position.X, (int)(position.Y + mgr.GetFontHeight(fnt.Name))); mgr.PopState(); }