LuaCanvas: add parameters for specifying location

Constructor now takes in arguments for setting the x and y coordinates of the canvas window
This commit is contained in:
Trivial-Man 2017-06-29 20:01:31 -06:00 committed by GitHub
parent eb6676e0ba
commit 5900f9b1ec
1 changed files with 11 additions and 1 deletions

View File

@ -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(