public void DrawUI(CanvasRenderingContext2D _canvas,
Point pos,
bool showOutline,
bool showCollideMap,
bool showHurtMap,
bool showOffset,
bool xflip,
bool yflip)
{
var fd = GetCache(showOutline, showCollideMap, showHurtMap);
_canvas.Save();
_canvas.Translate(pos.X, pos.Y);
if (xflip)
{
if (yflip)
{
_canvas.Translate(fd.Canvas.Width / 2d, fd.Canvas.Height / 2d);
_canvas.Rotate(-90 * Math.PI / 180);
_canvas.Translate(-fd.Canvas.Width / 2d, -fd.Canvas.Height / 2d);
_canvas.Translate(0, Height);
_canvas.Scale(1, -1);
}
else
{
_canvas.Translate(fd.Canvas.Width / 2d, fd.Canvas.Height / 2d);
_canvas.Rotate(-90 * Math.PI / 180);
_canvas.Translate(-fd.Canvas.Width / 2d, -fd.Canvas.Height / 2d);
}
}
else
{
if (yflip)
{
_canvas.Translate(0, Height);
_canvas.Scale(1, -1);
}
else { }
}
_canvas.DrawImage(fd.Canvas, 0, 0);
if (showOffset)
{
_canvas.BeginPath();
_canvas.MoveTo(OffsetX, 0);
_canvas.LineTo(OffsetX, Height);
_canvas.LineWidth = 1;
_canvas.StrokeStyle = "#000000";
_canvas.Stroke();
_canvas.BeginPath();
_canvas.MoveTo(0, OffsetY);
_canvas.LineTo(Width, OffsetY);
_canvas.LineWidth = 1;
_canvas.StrokeStyle = "#000000";
_canvas.Stroke();
}
_canvas.Restore();
}
}