Beispiel #1
0
 public void DrawIcon([LuaArbitraryStringParam] string path, int x, int y, int?width = null, int?height = null)
 {
     try
     {
         luaPictureBox.DrawIcon(LuaLibraryBase.FixString(path), x, y, width, height);
     }
     catch (Exception ex)
     {
         LogOutputCallback(ex.Message);
     }
 }
Beispiel #2
0
 public void DrawText(
     int x,
     int y,
     [LuaArbitraryStringParam] string message,
     [LuaColorParam] object foreColor = null,
     [LuaColorParam] object backColor = null,
     int?fontSize = null,
     [LuaASCIIStringParam] string fontFamily     = null,
     [LuaEnumStringParam] string fontStyle       = null,
     [LuaEnumStringParam] string horizontalAlign = null,
     [LuaEnumStringParam] string verticalAlign   = null)
 {
     luaPictureBox.DrawText(x, y, LuaLibraryBase.FixString(message), _th.SafeParseColor(foreColor), _th.SafeParseColor(backColor), fontSize, fontFamily, fontStyle, horizontalAlign, verticalAlign);
 }
Beispiel #3
0
        public void DrawImage(
            [LuaArbitraryStringParam] string path,
            int x,
            int y,
            int?width  = null,
            int?height = null,
            bool cache = true)
        {
            var path1 = LuaLibraryBase.FixString(path);

            if (!File.Exists(path1))
            {
                LogOutputCallback($"File not found: {path1}\nScript Terminated");
                return;
            }
            luaPictureBox.DrawImage(path1, x, y, width, height, cache);
        }
Beispiel #4
0
        public void DrawImageRegion(
            [LuaArbitraryStringParam] string path,
            int sourceX,
            int sourceY,
            int sourceWidth,
            int sourceHeight,
            int destX,
            int destY,
            int?destWidth  = null,
            int?destHeight = null)
        {
            var path1 = LuaLibraryBase.FixString(path);

            if (!File.Exists(path1))
            {
                LogOutputCallback($"File not found: {path1}\nScript Terminated");
                return;
            }
            luaPictureBox.DrawImageRegion(path1, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight);
        }
Beispiel #5
0
 public void SetTitle([LuaArbitraryStringParam] string title)
 => Text = LuaLibraryBase.FixString(title);
Beispiel #6
0
 public void SaveImageToDisk([LuaArbitraryStringParam] string path)
 {
     luaPictureBox.Image.Save(LuaLibraryBase.FixString(path).MakeAbsolute(_emuLib.PathEntries.ScreenshotAbsolutePathFor(_emuLib.GetSystemId())));
 }