public void DrawImage(Image image, WWUtils.Math.Vector2 <float> position, WWUtils.Math.Vector2 <float> Handle, float rotation, WWUtils.Math.Vector2 <float> scale) { ImageImpl img = image as ImageImpl; DrawImage(image, new Rect <float> (position.X, position.Y, img.subimage.size.X * scale.X, img.subimage.size.Y * scale.Y), Handle, rotation); }
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); }
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(); }
public void DrawText(Font font, string text, WWUtils.Math.Vector2 <float> position, WWUtils.Math.Vector2 <float> Handle, float rotation) { DrawText(font, text, position, Handle, rotation, new Vector2 <float> (1, 1), new Vector3 <byte> (255, 255, 255)); }
public void DrawImage(Image image, WWUtils.Math.Rect <float> destinationRect, WWUtils.Math.Vector2 <float> Handle, float rotation) { mgr.PushState(); mgr.Translate((int)-Handle.X, (int)-Handle.Y); mgr.Rotate(rotation); ImageImpl img = image as ImageImpl; mgr.DrawImage(img.JSImage, (int)img.subimage.position.X, (int)img.subimage.position.Y, (int)Math.Round(img.subimage.size.X), (int)Math.Round(img.subimage.size.Y), (int)destinationRect.position.X, (int)destinationRect.position.Y, (int)Math.Round(destinationRect.size.X), (int)Math.Round(destinationRect.size.Y)); mgr.PopState(); }
public void DrawImage(Image image, WWUtils.Math.Vector2 <float> position, WWUtils.Math.Vector2 <float> Handle, float rotation = 0f) { DrawImage(image, position, Handle, rotation, new Vector2 <float> (1, 1)); }