Added a gui.drawBox() function in the lua engine. Uses four coordinates to draw a box like other emulators rather than a height/width argument.
This commit is contained in:
parent
d6f3c05ecd
commit
cd292d7fd2
|
@ -284,6 +284,7 @@ namespace BizHawk.MultiClient
|
||||||
"cleartext",
|
"cleartext",
|
||||||
"drawPixel",
|
"drawPixel",
|
||||||
"drawLine",
|
"drawLine",
|
||||||
|
"drawBox",
|
||||||
"drawRectangle",
|
"drawRectangle",
|
||||||
"drawEllipse",
|
"drawEllipse",
|
||||||
"drawPolygon",
|
"drawPolygon",
|
||||||
|
@ -626,6 +627,33 @@ namespace BizHawk.MultiClient
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void gui_drawBox(object X, object Y, object X2, object Y2, object line, object background = null)
|
||||||
|
{
|
||||||
|
using (var g = luaSurface.GetGraphics())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int int_x = LuaInt(X);
|
||||||
|
int int_y = LuaInt(Y);
|
||||||
|
int int_width = Math.Abs(LuaInt(X) - LuaInt(X2));
|
||||||
|
int int_height = Math.Abs(LuaInt(Y) - LuaInt(Y2));
|
||||||
|
|
||||||
|
using (var pen = GetPen(line))
|
||||||
|
{
|
||||||
|
g.DrawRectangle(pen,int_x,int_y,int_width,int_height);
|
||||||
|
if (background != null)
|
||||||
|
using (var brush = GetBrush(background))
|
||||||
|
g.FillRectangle(brush, int_x, int_y, int_width, int_height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
// need to stop the script from here
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void gui_drawPixel(object X, object Y, object color = null)
|
public void gui_drawPixel(object X, object Y, object color = null)
|
||||||
{
|
{
|
||||||
using (var g = luaSurface.GetGraphics())
|
using (var g = luaSurface.GetGraphics())
|
||||||
|
|
Loading…
Reference in New Issue