From 8a2056193d50e661ab7d315762ffc747279360f5 Mon Sep 17 00:00:00 2001 From: Trivial-Man Date: Thu, 29 Jun 2017 20:16:02 -0600 Subject: [PATCH] LuaCanvas: Add SetLocation function Allows the user to reset the location of the canvas window at will while a script is running --- BizHawk.Client.EmuHawk/tools/Lua/LuaCanvas.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/BizHawk.Client.EmuHawk/tools/Lua/LuaCanvas.cs b/BizHawk.Client.EmuHawk/tools/Lua/LuaCanvas.cs index b8e55e2889..c73925ad5b 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/LuaCanvas.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/LuaCanvas.cs @@ -38,6 +38,16 @@ namespace BizHawk.Client.EmuHawk Text = title; } + [LuaMethodAttributes( + "SetLocation", + "Sets the location of the canvas window")] + public void SetLocation(int x, int y) + { + StartPosition = System.Windows.Forms.FormStartPosition.Manual; + Left = (int)x; + Top = (int)y; + } + [LuaMethodAttributes( "Clear", "Clears the canvas")]