From fd9005f36181c85a7c53bfded42972273f558166 Mon Sep 17 00:00:00 2001 From: rolanmen1 Date: Wed, 25 Apr 2012 20:34:50 +0000 Subject: [PATCH] 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 (\\). --- BizHawk.MultiClient/LuaImplementation.cs | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/BizHawk.MultiClient/LuaImplementation.cs b/BizHawk.MultiClient/LuaImplementation.cs index 6849076006..b6fa0e32aa 100644 --- a/BizHawk.MultiClient/LuaImplementation.cs +++ b/BizHawk.MultiClient/LuaImplementation.cs @@ -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 //----------------------------------------------------