Exemple #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);
     }
 }
Exemple #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);
 }
Exemple #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);
        }
Exemple #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);
        }
Exemple #5
0
 public void SetTitle([LuaArbitraryStringParam] string title)
 => Text = LuaLibraryBase.FixString(title);
Exemple #6
0
 public void SaveImageToDisk([LuaArbitraryStringParam] string path)
 {
     luaPictureBox.Image.Save(LuaLibraryBase.FixString(path).MakeAbsolute(_emuLib.PathEntries.ScreenshotAbsolutePathFor(_emuLib.GetSystemId())));
 }