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:
parent
eb6676e0ba
commit
5900f9b1ec
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue