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:
rolanmen1 2012-04-25 20:34:50 +00:00
parent 93335d287a
commit fd9005f361
1 changed files with 26 additions and 0 deletions

View File

@ -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
//----------------------------------------------------