From 5900f9b1ecddfcdc661fc8c7015e2672bbc46119 Mon Sep 17 00:00:00 2001 From: Trivial-Man Date: Thu, 29 Jun 2017 20:01:31 -0600 Subject: [PATCH] LuaCanvas: add parameters for specifying location Constructor now takes in arguments for setting the x and y coordinates of the canvas window --- BizHawk.Client.EmuHawk/tools/Lua/LuaCanvas.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/BizHawk.Client.EmuHawk/tools/Lua/LuaCanvas.cs b/BizHawk.Client.EmuHawk/tools/Lua/LuaCanvas.cs index d2ee8b9c34..0e25200353 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/LuaCanvas.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/LuaCanvas.cs @@ -12,12 +12,22 @@ namespace BizHawk.Client.EmuHawk [Description("Represents a canvas object returned by the gui.createcanvas() method")] public partial class LuaCanvas : Form { - public LuaCanvas(int width, int height) + public LuaCanvas(int width, int height, int? x = null, int? y = null) { InitializeComponent(); luaPictureBox.Width = width; luaPictureBox.Height = height; luaPictureBox.Image = new Bitmap(width, height); + + if (x.HasValue) + { + StartPosition = System.Windows.Forms.FormStartPosition.Manual; + Left = (int)x; + if (y.HasValue) + { + Top = (int)y; + } + } } [LuaMethodAttributes(