Example #1
0
        public Drawspace GetDrawspace(WWUtils.Math.Vector3 <float> position, WWUtils.Math.Vector2 <float> size,
                                      Action <Drawspace> loadedCB = null)
        {
            Drawspace ds = new DrawspaceImpl(mgr, position, size);

            if (loadedCB != null)
            {
                loadedCB(ds);
            }
            return(ds);
        }
Example #2
0
        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();
        }