gui.drawIcon implemented. It draws an Icon file (Path to File) in the specified X and Y Coordinates. It has 2 optional parameters, Width and Height. You can't resize the icon to be bigger than it's original size, only smaller. Oh, and Path must have double backslash (\\).
This commit is contained in:
parent
93335d287a
commit
fd9005f361
|
@ -260,6 +260,7 @@ namespace BizHawk.MultiClient
|
|||
"drawPolygon",
|
||||
"drawBezier",
|
||||
"drawPie",
|
||||
"drawIcon",
|
||||
};
|
||||
|
||||
public static string[] EmuFunctions = new string[]
|
||||
|
@ -649,6 +650,31 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
}
|
||||
|
||||
public void gui_drawIcon(object Path, object x, object y, object width = null, object height = null)
|
||||
{
|
||||
using (var g = luaSurface.GetGraphics())
|
||||
{
|
||||
try
|
||||
{
|
||||
Icon icon;
|
||||
if (width != null && height != null)
|
||||
{
|
||||
icon = new Icon(Path.ToString(), LuaInt(width), LuaInt(height));
|
||||
}
|
||||
else
|
||||
{
|
||||
icon = new Icon(Path.ToString());
|
||||
}
|
||||
|
||||
g.DrawIcon(icon, LuaInt(x), LuaInt(y));
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------
|
||||
//Emu library
|
||||
//----------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue