Second pool of examples.
This commit is contained in:
parent
07c07fd72a
commit
d91bd35a95
|
@ -151,8 +151,8 @@ namespace BizHawk.Client.Common
|
|||
catch
|
||||
{
|
||||
/*Eat it*/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("setanalog", "joypad.setanalog( { [ \"Tilt X\" ] = true, [ \"Tilt Y\" ] = false } );")]
|
||||
[LuaMethod("setanalog", "sets the given analog controls to their provided values for the current frame. Note that unlike set() there is only the logic of overriding with the given value.")]
|
||||
|
|
|
@ -36,18 +36,21 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public override string Name => "client";
|
||||
|
||||
[LuaMethodExample("exit", "client.exit( );")]
|
||||
[LuaMethod("exit", "Closes the emulator")]
|
||||
public void CloseEmulator()
|
||||
{
|
||||
GlobalWin.MainForm.CloseEmulator();
|
||||
}
|
||||
|
||||
[LuaMethodExample("exitCode", "client.exitCode( 0 );")]
|
||||
[LuaMethod("exitCode", "Closes the emulator and returns the provided code")]
|
||||
public void CloseEmulatorWithCode(int exitCode)
|
||||
{
|
||||
GlobalWin.MainForm.CloseEmulator(exitCode);
|
||||
}
|
||||
|
||||
[LuaMethodExample("borderheight", "local inclibor = client.borderheight( );")]
|
||||
[LuaMethod("borderheight", "Gets the current height in pixels of the letter/pillarbox area (top side only) around the emu display surface, excluding the gameExtraPadding you've set. This function (the whole lot of them) should be renamed or refactored since the padding areas have got more complex.")]
|
||||
public static int BorderHeight()
|
||||
{
|
||||
|
@ -55,6 +58,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return GlobalWin.DisplayManager.TransformPoint(point).Y;
|
||||
}
|
||||
|
||||
[LuaMethodExample("borderwidth", "local inclibor = client.borderwidth( );")]
|
||||
[LuaMethod("borderwidth", "Gets the current width in pixels of the letter/pillarbox area (left side only) around the emu display surface, excluding the gameExtraPadding you've set. This function (the whole lot of them) should be renamed or refactored since the padding areas have got more complex.")]
|
||||
public static int BorderWidth()
|
||||
{
|
||||
|
@ -62,36 +66,42 @@ namespace BizHawk.Client.EmuHawk
|
|||
return GlobalWin.DisplayManager.TransformPoint(point).X;
|
||||
}
|
||||
|
||||
[LuaMethodExample("bufferheight", "local inclibuf = client.bufferheight( );")]
|
||||
[LuaMethod("bufferheight", "Gets the visible height of the emu display surface (the core video output). This excludes the gameExtraPadding you've set.")]
|
||||
public int BufferHeight()
|
||||
{
|
||||
return VideoProvider.BufferHeight;
|
||||
}
|
||||
|
||||
[LuaMethodExample("bufferwidth", "local inclibuf = client.bufferwidth( );")]
|
||||
[LuaMethod("bufferwidth", "Gets the visible width of the emu display surface (the core video output). This excludes the gameExtraPadding you've set.")]
|
||||
public int BufferWidth()
|
||||
{
|
||||
return VideoProvider.BufferWidth;
|
||||
}
|
||||
|
||||
[LuaMethodExample("clearautohold", "client.clearautohold( );")]
|
||||
[LuaMethod("clearautohold", "Clears all autohold keys")]
|
||||
public void ClearAutohold()
|
||||
{
|
||||
GlobalWin.MainForm.ClearHolds();
|
||||
}
|
||||
|
||||
[LuaMethodExample("closerom", "client.closerom( );")]
|
||||
[LuaMethod("closerom", "Closes the loaded Rom")]
|
||||
public static void CloseRom()
|
||||
{
|
||||
GlobalWin.MainForm.CloseRom();
|
||||
}
|
||||
|
||||
[LuaMethodExample("enablerewind", "client.enablerewind( true );")]
|
||||
[LuaMethod("enablerewind", "Sets whether or not the rewind feature is enabled")]
|
||||
public void EnableRewind(bool enabled)
|
||||
{
|
||||
GlobalWin.MainForm.EnableRewind(enabled);
|
||||
}
|
||||
|
||||
[LuaMethodExample("frameskip", "client.frameskip( 8 );")]
|
||||
[LuaMethod("frameskip", "Sets the frame skip value of the client UI")]
|
||||
public void FrameSkip(int numFrames)
|
||||
{
|
||||
|
@ -106,18 +116,21 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("gettargetscanlineintensity", "local incliget = client.gettargetscanlineintensity( );")]
|
||||
[LuaMethod("gettargetscanlineintensity", "Gets the current scanline intensity setting, used for the scanline display filter")]
|
||||
public static int GetTargetScanlineIntensity()
|
||||
{
|
||||
return Global.Config.TargetScanlineFilterIntensity;
|
||||
}
|
||||
|
||||
[LuaMethodExample("getwindowsize", "local incliget = client.getwindowsize( );")]
|
||||
[LuaMethod("getwindowsize", "Gets the main window's size Possible values are 1, 2, 3, 4, 5, and 10")]
|
||||
public int GetWindowSize()
|
||||
{
|
||||
return Global.Config.TargetZoomFactors[Emulator.SystemId];
|
||||
}
|
||||
|
||||
[LuaMethodExample("SetGameExtraPadding", "client.SetGameExtraPadding( 5, 10, 15, 20 );")]
|
||||
[LuaMethod("SetGameExtraPadding", "Sets the extra padding added to the 'emu' surface so that you can draw HUD elements in predictable placements")]
|
||||
public static void SetGameExtraPadding(int left, int top, int right, int bottom)
|
||||
{
|
||||
|
@ -125,18 +138,21 @@ namespace BizHawk.Client.EmuHawk
|
|||
GlobalWin.MainForm.FrameBufferResized();
|
||||
}
|
||||
|
||||
[LuaMethodExample("SetSoundOn", "client.SetSoundOn( true );")]
|
||||
[LuaMethod("SetSoundOn", "Sets the state of the Sound On toggle")]
|
||||
public static void SetSoundOn(bool enable)
|
||||
{
|
||||
Global.Config.SoundEnabled = enable;
|
||||
}
|
||||
|
||||
[LuaMethodExample("GetSoundOn", "if ( client.GetSoundOn( ) ) then\r\n\tconsole.log( \"Gets the state of the Sound On toggle\" );\r\nend;")]
|
||||
[LuaMethod("GetSoundOn", "Gets the state of the Sound On toggle")]
|
||||
public static bool GetSoundOn()
|
||||
{
|
||||
return Global.Config.SoundEnabled;
|
||||
}
|
||||
|
||||
[LuaMethodExample("SetClientExtraPadding", "client.SetClientExtraPadding( 5, 10, 15, 20 );")]
|
||||
[LuaMethod("SetClientExtraPadding", "Sets the extra padding added to the 'native' surface so that you can draw HUD elements in predictable placements")]
|
||||
public static void SetClientExtraPadding(int left, int top, int right, int bottom)
|
||||
{
|
||||
|
@ -144,48 +160,56 @@ namespace BizHawk.Client.EmuHawk
|
|||
GlobalWin.MainForm.FrameBufferResized();
|
||||
}
|
||||
|
||||
[LuaMethodExample("ispaused", "if ( client.ispaused( ) ) then\r\n\tconsole.log( \"Returns true if emulator is paused, otherwise, false\" );\r\nend;")]
|
||||
[LuaMethod("ispaused", "Returns true if emulator is paused, otherwise, false")]
|
||||
public static bool IsPaused()
|
||||
{
|
||||
return GlobalWin.MainForm.EmulatorPaused;
|
||||
}
|
||||
|
||||
[LuaMethodExample("isturbo", "if ( client.client.isturbo( ) ) then\r\n\tconsole.log( \"Returns true if emulator is in turbo mode, otherwise, false\" );\r\nend;")]
|
||||
[LuaMethod("isturbo", "Returns true if emulator is in turbo mode, otherwise, false")]
|
||||
public static bool IsTurbo()
|
||||
{
|
||||
return GlobalWin.MainForm.IsTurboing;
|
||||
}
|
||||
|
||||
[LuaMethodExample("isseeking", "if ( client.isseeking( ) ) then\r\n\tconsole.log( \"Returns true if emulator is seeking, otherwise, false\" );\r\nend;")]
|
||||
[LuaMethod("isseeking", "Returns true if emulator is seeking, otherwise, false")]
|
||||
public static bool IsSeeking()
|
||||
{
|
||||
return GlobalWin.MainForm.IsSeeking;
|
||||
}
|
||||
|
||||
[LuaMethodExample("opencheats", "client.opencheats( );")]
|
||||
[LuaMethod("opencheats", "opens the Cheats dialog")]
|
||||
public static void OpenCheats()
|
||||
{
|
||||
GlobalWin.Tools.Load<Cheats>();
|
||||
}
|
||||
|
||||
[LuaMethodExample("openhexeditor", "client.openhexeditor( );")]
|
||||
[LuaMethod("openhexeditor", "opens the Hex Editor dialog")]
|
||||
public static void OpenHexEditor()
|
||||
{
|
||||
GlobalWin.Tools.Load<HexEditor>();
|
||||
}
|
||||
|
||||
[LuaMethodExample("openramwatch", "client.openramwatch( );")]
|
||||
[LuaMethod("openramwatch", "opens the RAM Watch dialog")]
|
||||
public static void OpenRamWatch()
|
||||
{
|
||||
GlobalWin.Tools.LoadRamWatch(loadDialog: true);
|
||||
}
|
||||
|
||||
[LuaMethodExample("openramsearch", "client.openramsearch( );")]
|
||||
[LuaMethod("openramsearch", "opens the RAM Search dialog")]
|
||||
public static void OpenRamSearch()
|
||||
{
|
||||
GlobalWin.Tools.Load<RamSearch>();
|
||||
}
|
||||
|
||||
[LuaMethodExample("openrom", "client.openrom( \"C:\\\" );")]
|
||||
[LuaMethod("openrom", "opens the Open ROM dialog")]
|
||||
public static void OpenRom(string path)
|
||||
{
|
||||
|
@ -193,36 +217,42 @@ namespace BizHawk.Client.EmuHawk
|
|||
GlobalWin.MainForm.LoadRom(path, new MainForm.LoadRomArgs { OpenAdvanced = ioa });
|
||||
}
|
||||
|
||||
[LuaMethodExample("opentasstudio", "client.opentasstudio( );")]
|
||||
[LuaMethod("opentasstudio", "opens the TAStudio dialog")]
|
||||
public static void OpenTasStudio()
|
||||
{
|
||||
GlobalWin.Tools.Load<TAStudio>();
|
||||
}
|
||||
|
||||
[LuaMethodExample("opentoolbox", "client.opentoolbox( );")]
|
||||
[LuaMethod("opentoolbox", "opens the Toolbox Dialog")]
|
||||
public static void OpenToolBox()
|
||||
{
|
||||
GlobalWin.Tools.Load<ToolBox>();
|
||||
}
|
||||
|
||||
[LuaMethodExample("opentracelogger", "client.opentracelogger( );")]
|
||||
[LuaMethod("opentracelogger", "opens the tracelogger if it is available for the given core")]
|
||||
public static void OpenTraceLogger()
|
||||
{
|
||||
GlobalWin.Tools.Load<TraceLogger>();
|
||||
}
|
||||
|
||||
[LuaMethodExample("pause", "client.pause( );")]
|
||||
[LuaMethod("pause", "Pauses the emulator")]
|
||||
public static void Pause()
|
||||
{
|
||||
GlobalWin.MainForm.PauseEmulator();
|
||||
}
|
||||
|
||||
[LuaMethodExample("pause_av", "client.pause_av( );")]
|
||||
[LuaMethod("pause_av", "If currently capturing Audio/Video, this will suspend the record. Frames will not be captured into the AV until client.unpause_av() is called")]
|
||||
public static void PauseAv()
|
||||
{
|
||||
GlobalWin.MainForm.PauseAvi = true;
|
||||
}
|
||||
|
||||
[LuaMethodExample("reboot_core", "client.reboot_core( );")]
|
||||
[LuaMethod("reboot_core", "Reboots the currently loaded core")]
|
||||
public static void RebootCore()
|
||||
{
|
||||
|
@ -231,12 +261,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
((LuaConsole)GlobalWin.Tools.Get<LuaConsole>()).LuaImp.IsRebootingCore = false;
|
||||
}
|
||||
|
||||
[LuaMethodExample("screenheight", "local incliscr = client.screenheight( );")]
|
||||
[LuaMethod("screenheight", "Gets the current height in pixels of the emulator's drawing area")]
|
||||
public static int ScreenHeight()
|
||||
{
|
||||
return GlobalWin.MainForm.PresentationPanel.NativeSize.Height;
|
||||
}
|
||||
|
||||
[LuaMethodExample("screenshot", "client.screenshot( \"C:\\\" );")]
|
||||
[LuaMethod("screenshot", "if a parameter is passed it will function as the Screenshot As menu item of EmuHawk, else it will function as the Screenshot menu item")]
|
||||
public static void Screenshot(string path = null)
|
||||
{
|
||||
|
@ -250,30 +282,35 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("screenshottoclipboard", "client.screenshottoclipboard( );")]
|
||||
[LuaMethod("screenshottoclipboard", "Performs the same function as EmuHawk's Screenshot To Clipboard menu item")]
|
||||
public static void ScreenshotToClipboard()
|
||||
{
|
||||
GlobalWin.MainForm.TakeScreenshotToClipboard();
|
||||
}
|
||||
|
||||
[LuaMethodExample("settargetscanlineintensity", "client.settargetscanlineintensity( -1000 );")]
|
||||
[LuaMethod("settargetscanlineintensity", "Sets the current scanline intensity setting, used for the scanline display filter")]
|
||||
public static void SetTargetScanlineIntensity(int val)
|
||||
{
|
||||
Global.Config.TargetScanlineFilterIntensity = val;
|
||||
}
|
||||
|
||||
[LuaMethodExample("setscreenshotosd", "client.setscreenshotosd( true );")]
|
||||
[LuaMethod("setscreenshotosd", "Sets the screenshot Capture OSD property of the client")]
|
||||
public static void SetScreenshotOSD(bool value)
|
||||
{
|
||||
Global.Config.Screenshot_CaptureOSD = value;
|
||||
}
|
||||
|
||||
[LuaMethodExample("screenwidth", "local incliscr = client.screenwidth( );")]
|
||||
[LuaMethod("screenwidth", "Gets the current width in pixels of the emulator's drawing area")]
|
||||
public static int ScreenWidth()
|
||||
{
|
||||
return GlobalWin.MainForm.PresentationPanel.NativeSize.Width;
|
||||
}
|
||||
|
||||
[LuaMethodExample("setwindowsize", "client.setwindowsize( 100 );")]
|
||||
[LuaMethod("setwindowsize", "Sets the main window's size to the give value. Accepted values are 1, 2, 3, 4, 5, and 10")]
|
||||
public void SetWindowSize(int size)
|
||||
{
|
||||
|
@ -289,6 +326,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("speedmode", "client.speedmode( 75 );")]
|
||||
[LuaMethod("speedmode", "Sets the speed of the emulator (in terms of percent)")]
|
||||
public void SpeedMode(int percent)
|
||||
{
|
||||
|
@ -302,12 +340,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("togglepause", "client.togglepause( );")]
|
||||
[LuaMethod("togglepause", "Toggles the current pause state")]
|
||||
public static void TogglePause()
|
||||
{
|
||||
GlobalWin.MainForm.TogglePause();
|
||||
}
|
||||
|
||||
[LuaMethodExample("transformPointX", "local inclitra = client.transformPointX( 16 );")]
|
||||
[LuaMethod("transformPointX", "Transforms an x-coordinate in emulator space to an x-coordinate in client space")]
|
||||
public static int TransformPointX(int x)
|
||||
{
|
||||
|
@ -315,6 +355,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return GlobalWin.DisplayManager.TransformPoint(point).X;
|
||||
}
|
||||
|
||||
[LuaMethodExample("transformPointY", "local inclitra = client.transformPointY( 32 );")]
|
||||
[LuaMethod("transformPointY", "Transforms an y-coordinate in emulator space to an y-coordinate in client space")]
|
||||
public static int TransformPointY(int y)
|
||||
{
|
||||
|
@ -322,30 +363,35 @@ namespace BizHawk.Client.EmuHawk
|
|||
return GlobalWin.DisplayManager.TransformPoint(point).Y;
|
||||
}
|
||||
|
||||
[LuaMethodExample("unpause", "client.unpause( );")]
|
||||
[LuaMethod("unpause", "Unpauses the emulator")]
|
||||
public static void Unpause()
|
||||
{
|
||||
GlobalWin.MainForm.UnpauseEmulator();
|
||||
}
|
||||
|
||||
[LuaMethodExample("unpause_av", "client.unpause_av( );")]
|
||||
[LuaMethod("unpause_av", "If currently capturing Audio/Video this resumes capturing")]
|
||||
public static void UnpauseAv()
|
||||
{
|
||||
GlobalWin.MainForm.PauseAvi = false;
|
||||
}
|
||||
|
||||
[LuaMethodExample("xpos", "local inclixpo = client.xpos( );")]
|
||||
[LuaMethod("xpos", "Returns the x value of the screen position where the client currently sits")]
|
||||
public static int Xpos()
|
||||
{
|
||||
return GlobalWin.MainForm.DesktopLocation.X;
|
||||
}
|
||||
|
||||
[LuaMethodExample("ypos", "local incliypo = client.ypos( );")]
|
||||
[LuaMethod("ypos", "Returns the y value of the screen position where the client currently sits")]
|
||||
public static int Ypos()
|
||||
{
|
||||
return GlobalWin.MainForm.DesktopLocation.Y;
|
||||
}
|
||||
|
||||
[LuaMethodExample("getavailabletools", "local nlcliget = client.getavailabletools( );")]
|
||||
[LuaMethod("getavailabletools", "Returns a list of the tools currently open")]
|
||||
public LuaTable GetAvailableTools()
|
||||
{
|
||||
|
@ -359,6 +405,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return t;
|
||||
}
|
||||
|
||||
[LuaMethodExample("gettool", "local nlcliget = client.gettool( \"Tool name\" );")]
|
||||
[LuaMethod("gettool", "Returns an object that represents a tool of the given name (not case sensitive). If the tool is not open, it will be loaded if available. Use gettools to get a list of names")]
|
||||
public LuaTable GetTool(string name)
|
||||
{
|
||||
|
@ -381,6 +428,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return null;
|
||||
}
|
||||
|
||||
[LuaMethodExample("createinstance", "local nlclicre = client.createinstance( \"objectname\" );")]
|
||||
[LuaMethod("createinstance", "returns a default instance of the given type of object if it exists (not case sensitive). Note: This will only work on objects which have a parameterless constructor. If no suitable type is found, or the type does not have a parameterless constructor, then nil is returned")]
|
||||
public LuaTable CreateInstance(string name)
|
||||
{
|
||||
|
@ -395,12 +443,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
return null;
|
||||
}
|
||||
|
||||
[LuaMethodExample("displaymessages", "client.displaymessages( true );")]
|
||||
[LuaMethod("displaymessages", "sets whether or not on screen messages will display")]
|
||||
public void DisplayMessages(bool value)
|
||||
{
|
||||
Global.Config.DisplayMessages = value;
|
||||
}
|
||||
|
||||
[LuaMethodExample("saveram", "client.saveram( );")]
|
||||
[LuaMethod("saveram", "flushes save ram to disk")]
|
||||
public void SaveRam()
|
||||
{
|
||||
|
|
|
@ -18,6 +18,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public override string Name => "console";
|
||||
|
||||
[LuaMethodExample("clear", "console.clear( );")]
|
||||
[LuaMethod("clear", "clears the output box of the Lua Console window")]
|
||||
public static void Clear()
|
||||
{
|
||||
|
@ -27,6 +28,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("getluafunctionslist", "local stconget = console.getluafunctionslist( );")]
|
||||
[LuaMethod("getluafunctionslist", "returns a list of implemented functions")]
|
||||
public static string GetLuaFunctionsList()
|
||||
{
|
||||
|
@ -39,6 +41,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return list.ToString();
|
||||
}
|
||||
|
||||
[LuaMethodExample("log", "console.log( \"New log.\" );")]
|
||||
[LuaMethod("log", "Outputs the given object to the output box on the Lua Console dialog. Note: Can accept a LuaTable")]
|
||||
public static void Log(params object[] outputs)
|
||||
{
|
||||
|
@ -57,6 +60,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("writeline", "console.writeline( \"New log line.\" );")]
|
||||
[LuaMethod("writeline", "Outputs the given object to the output box on the Lua Console dialog. Note: Can accept a LuaTable")]
|
||||
public static void WriteLine(params object[] outputs)
|
||||
{
|
||||
|
@ -66,6 +70,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("write", "console.write( \"New log message.\" );")]
|
||||
[LuaMethod("write", "Outputs the given object to the output box on the Lua Console dialog. Note: Can accept a LuaTable")]
|
||||
public static void Write(params object[] outputs)
|
||||
{
|
||||
|
|
|
@ -62,6 +62,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
#endregion
|
||||
|
||||
[LuaMethodExample("addclick", "forms.addclick( 332, function()\r\n\tconsole.log( \"adds the given lua function as a click event to the given control\" );\r\nend );")]
|
||||
[LuaMethod("addclick", "adds the given lua function as a click event to the given control")]
|
||||
public void AddClick(int handle, LuaFunction clickEvent)
|
||||
{
|
||||
|
@ -78,6 +79,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("button", "local inforbut = forms.button( 333, \"Caption\", function()\r\n\tconsole.log( \"Creates a button control on the given form. The caption property will be the text value on the button. clickEvent is the name of a Lua function that will be invoked when the button is clicked. x, and y are the optional location parameters for the position of the button within the given form. The function returns the handle of the created button. Width and Height are optional, if not specified they will be a default size\" );\r\nend, 2, 48, 18, 24 );")]
|
||||
[LuaMethod(
|
||||
"button", "Creates a button control on the given form. The caption property will be the text value on the button. clickEvent is the name of a Lua function that will be invoked when the button is clicked. x, and y are the optional location parameters for the position of the button within the given form. The function returns the handle of the created button. Width and Height are optional, if not specified they will be a default size")]
|
||||
public int Button(
|
||||
|
@ -113,6 +115,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return (int)button.Handle;
|
||||
}
|
||||
|
||||
[LuaMethodExample("checkbox", "local inforche = forms.checkbox( 333, \"Caption\", 2, 48 );")]
|
||||
[LuaMethod(
|
||||
"checkbox", "Creates a checkbox control on the given form. The caption property will be the text of the checkbox. x and y are the optional location parameters for the position of the checkbox within the form")]
|
||||
public int Checkbox(int formHandle, string caption, int? x = null, int? y = null)
|
||||
|
@ -135,6 +138,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return (int)checkbox.Handle;
|
||||
}
|
||||
|
||||
[LuaMethodExample("clearclicks", "forms.clearclicks( 332 );")]
|
||||
[LuaMethod("clearclicks", "Removes all click events from the given widget at the specified handle")]
|
||||
public void ClearClicks(int handle)
|
||||
{
|
||||
|
@ -155,6 +159,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("destroy", "if ( forms.destroy( 332 ) ) then\r\n\tconsole.log( \"Closes and removes a Lua created form with the specified handle. If a dialog was found and removed true is returned, else false\" );\r\nend;")]
|
||||
[LuaMethod("destroy", "Closes and removes a Lua created form with the specified handle. If a dialog was found and removed true is returned, else false")]
|
||||
public bool Destroy(int handle)
|
||||
{
|
||||
|
@ -172,6 +177,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return false;
|
||||
}
|
||||
|
||||
[LuaMethodExample("destroyall", "forms.destroyall();")]
|
||||
[LuaMethod("destroyall", "Closes and removes all Lua created dialogs")]
|
||||
public void DestroyAll()
|
||||
{
|
||||
|
@ -181,6 +187,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("dropdown", "local infordro = forms.dropdown(333, { \"item 1\", \"item2\" }, 2, 48, 18, 24);")]
|
||||
[LuaMethod(
|
||||
"dropdown", "Creates a dropdown (with a ComboBoxStyle of DropDownList) control on the given form. Dropdown items are passed via a lua table. Only the values will be pulled for the dropdown items, the keys are irrelevant. Items will be sorted alphabetically. x and y are the optional location parameters, and width and height are the optional size parameters.")]
|
||||
public int Dropdown(
|
||||
|
@ -216,6 +223,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return (int)dropdown.Handle;
|
||||
}
|
||||
|
||||
[LuaMethodExample("getproperty", "local stforget = forms.getproperty(332, \"Property\");")]
|
||||
[LuaMethod("getproperty", "returns a string representation of the value of a property of the widget at the given handle")]
|
||||
public string GetProperty(int handle, string property)
|
||||
{
|
||||
|
@ -246,6 +254,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return "";
|
||||
}
|
||||
|
||||
[LuaMethodExample("gettext", "local stforget = forms.gettext(332);")]
|
||||
[LuaMethod("gettext", "Returns the text property of a given form or control")]
|
||||
public string GetText(int handle)
|
||||
{
|
||||
|
@ -281,6 +290,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return "";
|
||||
}
|
||||
|
||||
[LuaMethodExample("ischecked", "if ( forms.ischecked( 332 ) ) then\r\n\tconsole.log( \"Returns the given checkbox's checked property\" );\r\nend;")]
|
||||
[LuaMethod("ischecked", "Returns the given checkbox's checked property")]
|
||||
public bool IsChecked(int handle)
|
||||
{
|
||||
|
@ -309,6 +319,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return false;
|
||||
}
|
||||
|
||||
[LuaMethodExample("label", "local inforlab = forms.label( 333, \"Caption\", 2, 48, 18, 24, false );")]
|
||||
[LuaMethod(
|
||||
"label", "Creates a label control on the given form. The caption property is the text of the label. x, and y are the optional location parameters for the position of the label within the given form. The function returns the handle of the created label. Width and Height are optional, if not specified they will be a default size.")]
|
||||
public int Label(
|
||||
|
@ -348,6 +359,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return (int)label.Handle;
|
||||
}
|
||||
|
||||
[LuaMethodExample("newform", "local infornew = forms.newform( 18, 24, \"Title\", function()\r\n\tconsole.log( \"creates a new default dialog, if both width and height are specified it will create a dialog of the specified size. If title is specified it will be the caption of the dialog, else the dialog caption will be 'Lua Dialog'. The function will return an int representing the handle of the dialog created.\" );\r\nend );")]
|
||||
[LuaMethod(
|
||||
"newform", "creates a new default dialog, if both width and height are specified it will create a dialog of the specified size. If title is specified it will be the caption of the dialog, else the dialog caption will be 'Lua Dialog'. The function will return an int representing the handle of the dialog created.")]
|
||||
public int NewForm(int? width = null, int? height = null, string title = null, LuaFunction onClose = null)
|
||||
|
@ -383,6 +395,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return (int)form.Handle;
|
||||
}
|
||||
|
||||
[LuaMethodExample("openfile", "local stforope = forms.openfile( \"C:\\filename.bin\", \"C:\\\", \"All files ( *.* )|*.*\");")]
|
||||
[LuaMethod(
|
||||
"openfile", "Creates a standard openfile dialog with optional parameters for the filename, directory, and filter. The return value is the directory that the user picked. If they chose to cancel, it will return an empty string")]
|
||||
public string OpenFile(string fileName = null, string initialDirectory = null, string filter = "All files (*.*)|*.*")
|
||||
|
@ -413,6 +426,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return "";
|
||||
}
|
||||
|
||||
[LuaMethodExample("pictureBox", "local inforpic = forms.pictureBox( 333, 2, 48, 18, 24 );")]
|
||||
[LuaMethod(
|
||||
"pictureBox",
|
||||
"Creates a new drawing area in the form. Optionally the location in the form as well as the size of the drawing area can be specified. Returns the handle the component can be refered to with.")]
|
||||
|
@ -444,6 +458,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
#region LuaPictureBox Methods
|
||||
|
||||
[LuaMethodExample("clear", "forms.clear( 334, 0x000000FF );")]
|
||||
[LuaMethod(
|
||||
"clear",
|
||||
"Clears the canvas")]
|
||||
|
@ -475,6 +490,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("refresh", "forms.refresh( 334 );")]
|
||||
[LuaMethod(
|
||||
"refresh",
|
||||
"Redraws the canvas")]
|
||||
|
@ -506,6 +522,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("setDefaultForegroundColor", "forms.setDefaultForegroundColor( 334, 0xFFFFFFFF );")]
|
||||
[LuaMethod(
|
||||
"setDefaultForegroundColor",
|
||||
"Sets the default foreground color to use in drawing methods, white by default")]
|
||||
|
@ -537,6 +554,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("setDefaultBackgroundColor", "forms.setDefaultBackgroundColor( 334, 0x000000FF );")]
|
||||
[LuaMethod(
|
||||
"setDefaultBackgroundColor",
|
||||
"Sets the default background color to use in drawing methods, transparent by default")]
|
||||
|
@ -568,6 +586,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("setDefaultTextBackground", "forms.setDefaultTextBackground( 334, 0x000000FF );")]
|
||||
[LuaMethod(
|
||||
"setDefaultTextBackground",
|
||||
"Sets the default backgroiund color to use in text drawing methods, half-transparent black by default")]
|
||||
|
@ -599,6 +618,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawBezier", "forms.drawBezier( 334, { { 5, 10 }, { 10, 10 }, { 10, 20 }, { 5, 20 } }, 0x000000FF );")]
|
||||
[LuaMethod(
|
||||
"drawBezier",
|
||||
"Draws a Bezier curve using the table of coordinates provided in the given color")]
|
||||
|
@ -630,6 +650,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawBox", "forms.drawBox( 334, 16, 32, 162, 322, 0x007F00FF, 0x7F7F7FFF );")]
|
||||
[LuaMethod(
|
||||
"drawBox",
|
||||
"Draws a rectangle on screen from x1/y1 to x2/y2. Same as drawRectangle except it receives two points intead of a point and width/height")]
|
||||
|
@ -661,6 +682,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawEllipse", "forms.drawEllipse( 334, 16, 32, 77, 99, 0x007F00FF, 0x7F7F7FFF );")]
|
||||
[LuaMethod(
|
||||
"drawEllipse",
|
||||
"Draws an ellipse at the given coordinates and the given width and height. Line is the color of the ellipse. Background is the optional fill color")]
|
||||
|
@ -692,6 +714,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawIcon", "forms.drawIcon( 334, \"C:\\icon.ico\", 16, 32, 18, 24 );")]
|
||||
[LuaMethod(
|
||||
"drawIcon",
|
||||
"draws an Icon (.ico) file from the given path at the given coordinate. width and height are optional. If specified, it will resize the image accordingly")]
|
||||
|
@ -723,6 +746,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawImage", "forms.drawImage( 334, \"C:\\image.png\", 16, 32, 18, 24, false );")]
|
||||
[LuaMethod(
|
||||
"drawImage",
|
||||
"draws an image file from the given path at the given coordinate. width and height are optional. If specified, it will resize the image accordingly")]
|
||||
|
@ -759,6 +783,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("clearImageCache", "forms.clearImageCache( 334 );")]
|
||||
[LuaMethod(
|
||||
"clearImageCache",
|
||||
"clears the image cache that is built up by using gui.drawImage, also releases the file handle for cached images")]
|
||||
|
@ -790,6 +815,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawImageRegion", "forms.drawImageRegion( 334, \"C:\\image.bmp\", 11, 22, 33, 44, 21, 43, 34, 45 );")]
|
||||
[LuaMethod(
|
||||
"drawImageRegion",
|
||||
"draws a given region of an image file from the given path at the given coordinate, and optionally with the given size")]
|
||||
|
@ -826,6 +852,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawLine", "forms.drawLine( 334, 161, 321, 162, 322, 0xFFFFFFFF );")]
|
||||
[LuaMethod(
|
||||
"drawLine",
|
||||
"Draws a line from the first coordinate pair to the 2nd. Color is optional (if not specified it will be drawn black)")]
|
||||
|
@ -857,6 +884,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawAxis", "forms.drawAxis( 334, 16, 32, int size, 0xFFFFFFFF );")]
|
||||
[LuaMethod(
|
||||
"drawAxis",
|
||||
"Draws an axis of the specified size at the coordinate pair.)")]
|
||||
|
@ -888,6 +916,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawArc", "forms.drawArc( 334, 16, 32, 77, 99, 180, 90, 0x007F00FF );")]
|
||||
[LuaMethod(
|
||||
"drawArc",
|
||||
"draws a Arc shape at the given coordinates and the given width and height"
|
||||
|
@ -920,6 +949,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawPie", "forms.drawPie( 334, 16, 32, 77, 99, 180, 90, 0x007F00FF, 0x7F7F7FFF );")]
|
||||
[LuaMethod(
|
||||
"drawPie",
|
||||
"draws a Pie shape at the given coordinates and the given width and height")]
|
||||
|
@ -960,6 +990,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawPixel", "forms.drawPixel( 334, 16, 32, 0xFFFFFFFF );")]
|
||||
[LuaMethod(
|
||||
"drawPixel",
|
||||
"Draws a single pixel at the given coordinates in the given color. Color is optional (if not specified it will be drawn black)")]
|
||||
|
@ -991,6 +1022,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawPolygon", "forms.drawPolygon( 334, { { 5, 10 }, { 10, 10 }, { 10, 20 }, { 5, 20 } }, 0x007F00FF, 0x7F7F7FFF );")]
|
||||
[LuaMethod(
|
||||
"drawPolygon",
|
||||
"Draws a polygon using the table of coordinates specified in points. This should be a table of tables(each of size 2). Line is the color of the polygon. Background is the optional fill color")]
|
||||
|
@ -1023,6 +1055,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
|
||||
[LuaMethodExample("drawRectangle", "forms.drawRectangle( 334, 16, 32, 77, 99, 0x007F00FF, 0x7F7F7FFF );")]
|
||||
[LuaMethod(
|
||||
"drawRectangle",
|
||||
"Draws a rectangle at the given coordinate and the given width and height. Line is the color of the box. Background is the optional fill color")]
|
||||
|
@ -1054,6 +1087,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawString", "forms.drawString( 334, 16, 32, \"Some message\", 0x7F0000FF, 0x00007FFF, 8, \"Arial Narrow\", \"bold\", \"center\", \"middle\" );")]
|
||||
[LuaMethod(
|
||||
"drawString",
|
||||
"Alias of DrawText()")]
|
||||
|
@ -1096,6 +1130,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawText", "forms.drawText( 334, 16, 32, \"Some message\", 0x7F0000FF, 0x00007FFF, 8, \"Arial Narrow\", \"bold\", \"center\", \"middle\" );")]
|
||||
[LuaMethod(
|
||||
"drawText",
|
||||
"Draws the given message at the given x,y coordinates and the given color. The default color is white. A fontfamily can be specified and is monospace generic if none is specified (font family options are the same as the .NET FontFamily class). The fontsize default is 12. The default font style is regular. Font style options are regular, bold, italic, strikethrough, underline. Horizontal alignment options are left (default), center, or right. Vertical alignment options are bottom (default), middle, or top. Alignment options specify which ends of the text will be drawn at the x and y coordinates.")]
|
||||
|
@ -1139,6 +1174,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
// It'd be great if these were simplified into 1 function, but I cannot figure out how to return a LuaTable from this class
|
||||
[LuaMethodExample("getMouseX", "local inforget = forms.getMouseX( 334 );")]
|
||||
[LuaMethod(
|
||||
"getMouseX",
|
||||
"Returns an integer representation of the mouse X coordinate relative to the PictureBox.")]
|
||||
|
@ -1173,6 +1209,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return 0;
|
||||
}
|
||||
|
||||
[LuaMethodExample("getMouseY", "local inforget = forms.getMouseY( 334 );")]
|
||||
[LuaMethod(
|
||||
"getMouseY",
|
||||
"Returns an integer representation of the mouse Y coordinate relative to the PictureBox.")]
|
||||
|
@ -1209,6 +1246,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
#endregion
|
||||
|
||||
[LuaMethodExample("setdropdownitems", "forms.setdropdownitems( 332, { \"item1\", \"item2\" } );")]
|
||||
[LuaMethod("setdropdownitems", "Sets the items for a given dropdown box")]
|
||||
public void SetDropdownItems(int handle, LuaTable items)
|
||||
{
|
||||
|
@ -1244,6 +1282,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("setlocation", "forms.setlocation( 332, 16, 32 );")]
|
||||
[LuaMethod("setlocation", "Sets the location of a control or form by passing in the handle of the created object")]
|
||||
public void SetLocation(int handle, int x, int y)
|
||||
{
|
||||
|
@ -1267,6 +1306,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("setproperty", "forms.setproperty( 332, \"Property\", \"Property value\" );")]
|
||||
[LuaMethod("setproperty", "Attempts to set the given property of the widget with the given value. Note: not all properties will be able to be represented for the control to accept")]
|
||||
public void SetProperty(int handle, string property, object value)
|
||||
{
|
||||
|
@ -1322,12 +1362,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("createcolor", "local coforcre = forms.createcolor( 0x7F, 0x3F, 0x1F, 0xCF );")]
|
||||
[LuaMethod("createcolor", "Creates a color object useful with setproperty")]
|
||||
public Color CreateColor(int r, int g, int b, int a)
|
||||
{
|
||||
return Color.FromArgb(a, r, g, b);
|
||||
}
|
||||
|
||||
[LuaMethodExample("setsize", "forms.setsize( 332, 77, 99 );")]
|
||||
[LuaMethod("setsize", "TODO")]
|
||||
public void SetSize(int handle, int width, int height)
|
||||
{
|
||||
|
@ -1351,6 +1393,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("settext", "forms.settext( 332, \"Caption\" );")]
|
||||
[LuaMethod("settext", "Sets the text property of a control or form by passing in the handle of the created object")]
|
||||
public void Settext(int handle, string caption)
|
||||
{
|
||||
|
@ -1374,6 +1417,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("textbox", "local infortex = forms.textbox( 333, \"Caption\", 18, 24, \"HEX\", 2, 48, true, false, \"Both\" );")]
|
||||
[LuaMethod(
|
||||
"textbox", "Creates a textbox control on the given form. The caption property will be the initial value of the textbox (default is empty). Width and Height are option, if not specified they will be a default size of 100, 20. Type is an optional property to restrict the textbox input. The available options are HEX, SIGNED, and UNSIGNED. Passing it null or any other value will set it to no restriction. x, and y are the optional location parameters for the position of the textbox within the given form. The function returns the handle of the created textbox. If true, the multiline will enable the standard winform multi-line property. If true, the fixedWidth options will create a fixed width font. Scrollbars is an optional property to specify which scrollbars to display. The available options are Vertical, Horizontal, Both, and None. Scrollbars are only shown on a multiline textbox")]
|
||||
public int Textbox(
|
||||
|
|
|
@ -45,6 +45,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public bool SurfaceIsNull => _luaSurface == null;
|
||||
|
||||
[LuaMethodExample("DrawNew", "gui.DrawNew( \"native\", false );")]
|
||||
[LuaMethod("DrawNew", "Changes drawing target to the specified lua surface name. This may clobber any previous drawing to this surface (pass false if you don't want it to)")]
|
||||
public void DrawNew(string name, bool? clear = true)
|
||||
{
|
||||
|
@ -59,6 +60,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("DrawFinish", "gui.DrawFinish( );")]
|
||||
[LuaMethod("DrawFinish", "Finishes drawing to the current lua surface and causes it to get displayed.")]
|
||||
public void DrawFinish()
|
||||
{
|
||||
|
@ -126,12 +128,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
#endregion
|
||||
|
||||
[LuaMethodExample("addmessage", "gui.addmessage( \"Some message\" );")]
|
||||
[LuaMethod("addmessage", "Adds a message to the OSD's message area")]
|
||||
public void AddMessage(string message)
|
||||
{
|
||||
GlobalWin.OSD.AddMessage(message);
|
||||
}
|
||||
|
||||
[LuaMethodExample("clearGraphics", "gui.clearGraphics( );")]
|
||||
[LuaMethod("clearGraphics", "clears all lua drawn graphics from the screen")]
|
||||
public void ClearGraphics()
|
||||
{
|
||||
|
@ -139,30 +143,35 @@ namespace BizHawk.Client.EmuHawk
|
|||
DrawFinish();
|
||||
}
|
||||
|
||||
[LuaMethodExample("cleartext", "gui.cleartext( );")]
|
||||
[LuaMethod("cleartext", "clears all text created by gui.text()")]
|
||||
public static void ClearText()
|
||||
{
|
||||
GlobalWin.OSD.ClearGUIText();
|
||||
}
|
||||
|
||||
[LuaMethodExample("defaultForeground", "gui.defaultForeground( 0x000000FF );")]
|
||||
[LuaMethod("defaultForeground", "Sets the default foreground color to use in drawing methods, white by default")]
|
||||
public void SetDefaultForegroundColor(Color color)
|
||||
{
|
||||
_defaultForeground = color;
|
||||
}
|
||||
|
||||
[LuaMethodExample("defaultBackground", "gui.defaultBackground( 0xFFFFFFFF );")]
|
||||
[LuaMethod("defaultBackground", "Sets the default background color to use in drawing methods, transparent by default")]
|
||||
public void SetDefaultBackgroundColor(Color color)
|
||||
{
|
||||
_defaultBackground = color;
|
||||
}
|
||||
|
||||
[LuaMethodExample("defaultTextBackground", "gui.defaultTextBackground( 0x000000FF );")]
|
||||
[LuaMethod("defaultTextBackground", "Sets the default backgroiund color to use in text drawing methods, half-transparent black by default")]
|
||||
public void SetDefaultTextBackground(Color color)
|
||||
{
|
||||
_defaultTextBackground = color;
|
||||
}
|
||||
|
||||
[LuaMethodExample("defaultPixelFont", "gui.defaultPixelFont( \"Arial Narrow\");")]
|
||||
[LuaMethod("defaultPixelFont", "Sets the default font to use in gui.pixelText(). Two font families are available, \"fceux\" and \"gens\" (or \"0\" and \"1\" respectively), \"gens\" is used by default")]
|
||||
public void SetDefaultTextBackground(string fontfamily)
|
||||
{
|
||||
|
@ -182,6 +191,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawBezier", "gui.drawBezier( { { 5, 10 }, { 10, 10 }, { 10, 20 }, { 5, 20 } }, 0x000000FF );")]
|
||||
[LuaMethod("drawBezier", "Draws a Bezier curve using the table of coordinates provided in the given color")]
|
||||
public void DrawBezier(LuaTable points, Color color)
|
||||
{
|
||||
|
@ -211,6 +221,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawBox", "gui.drawBox( 16, 32, 162, 322, 0x007F00FF, 0x7F7F7FFF );")]
|
||||
[LuaMethod("drawBox", "Draws a rectangle on screen from x1/y1 to x2/y2. Same as drawRectangle except it receives two points intead of a point and width/height")]
|
||||
public void DrawBox(int x, int y, int x2, int y2, Color? line = null, Color? background = null)
|
||||
{
|
||||
|
@ -254,6 +265,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawEllipse", "gui.drawEllipse( 16, 32, 77, 99, 0x007F00FF, 0x7F7F7FFF );")]
|
||||
[LuaMethod("drawEllipse", "Draws an ellipse at the given coordinates and the given width and height. Line is the color of the ellipse. Background is the optional fill color")]
|
||||
public void DrawEllipse(int x, int y, int width, int height, Color? line = null, Color? background = null)
|
||||
{
|
||||
|
@ -278,6 +290,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawIcon", "gui.drawIcon( \"C:\\sample.ico\", 16, 32, 18, 24 );")]
|
||||
[LuaMethod("drawIcon", "draws an Icon (.ico) file from the given path at the given coordinate. width and height are optional. If specified, it will resize the image accordingly")]
|
||||
public void DrawIcon(string path, int x, int y, int? width = null, int? height = null)
|
||||
{
|
||||
|
@ -304,6 +317,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawImage", "gui.drawImage( \"C:\\sample.bmp\", 16, 32, 18, 24, false );")]
|
||||
[LuaMethod("drawImage", "draws an image file from the given path at the given coordinate. width and height are optional. If specified, it will resize the image accordingly")]
|
||||
public void DrawImage(string path, int x, int y, int? width = null, int? height = null, bool cache = true)
|
||||
{
|
||||
|
@ -333,6 +347,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("clearImageCache", "gui.clearImageCache( );")]
|
||||
[LuaMethod("clearImageCache", "clears the image cache that is built up by using gui.drawImage, also releases the file handle for cached images")]
|
||||
public void ClearImageCache()
|
||||
{
|
||||
|
@ -344,6 +359,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
_imageCache.Clear();
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawImageRegion", "gui.drawImageRegion( \"C:\\sample.png\", 11, 22, 33, 44, 21, 43, 34, 45 );")]
|
||||
[LuaMethod("drawImageRegion", "draws a given region of an image file from the given path at the given coordinate, and optionally with the given size")]
|
||||
public void DrawImageRegion(string path, int source_x, int source_y, int source_width, int source_height, int dest_x, int dest_y, int? dest_width = null, int? dest_height = null)
|
||||
{
|
||||
|
@ -372,6 +388,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawLine", "gui.drawLine( 161, 321, 162, 322, 0xFFFFFFFF );")]
|
||||
[LuaMethod("drawLine", "Draws a line from the first coordinate pair to the 2nd. Color is optional (if not specified it will be drawn black)")]
|
||||
public void DrawLine(int x1, int y1, int x2, int y2, Color? color = null)
|
||||
{
|
||||
|
@ -381,6 +398,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawAxis", "gui.drawAxis( 16, 32, 15, 0xFFFFFFFF );")]
|
||||
[LuaMethod("drawAxis", "Draws an axis of the specified size at the coordinate pair.)")]
|
||||
public void DrawAxis(int x, int y, int size, Color? color = null)
|
||||
{
|
||||
|
@ -388,6 +406,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
DrawLine(x, y + size, x, y - size, color);
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawPie", "gui.drawPie( 16, 32, 77, 99, 180, 90, 0x007F00FF, 0x7F7F7FFF );")]
|
||||
[LuaMethod("drawPie", "draws a Pie shape at the given coordinates and the given width and height")]
|
||||
public void DrawPie(
|
||||
int x,
|
||||
|
@ -412,6 +431,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawPixel", "gui.drawPixel( 16, 32, 0xFFFFFFFF );")]
|
||||
[LuaMethod("drawPixel", "Draws a single pixel at the given coordinates in the given color. Color is optional (if not specified it will be drawn black)")]
|
||||
public void DrawPixel(int x, int y, Color? color = null)
|
||||
{
|
||||
|
@ -428,6 +448,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawPolygon", "gui.drawPolygon( { { 5, 10 }, { 10, 10 }, { 10, 20 }, { 5, 20 } }, 0x007F00FF, 0x7F7F7FFF );")]
|
||||
[LuaMethod("drawPolygon", "Draws a polygon using the table of coordinates specified in points. This should be a table of tables(each of size 2). Line is the color of the polygon. Background is the optional fill color")]
|
||||
public void DrawPolygon(LuaTable points, Color? line = null, Color? background = null)
|
||||
{
|
||||
|
@ -457,6 +478,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawRectangle", "gui.drawRectangle( 16, 32, 77, 99, 0x007F00FF, 0x7F7F7FFF );")]
|
||||
[LuaMethod("drawRectangle", "Draws a rectangle at the given coordinate and the given width and height. Line is the color of the box. Background is the optional fill color")]
|
||||
public void DrawRectangle(int x, int y, int width, int height, Color? line = null, Color? background = null)
|
||||
{
|
||||
|
@ -471,6 +493,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawString", "gui.drawString( 16, 32, \"Some message\", 0x7F0000FF, 0x00007FFF, 8, \"Arial Narrow\", \"bold\", \"center\", \"middle\" );")]
|
||||
[LuaMethod("drawString", "Alias of gui.drawText()")]
|
||||
public void DrawString(
|
||||
int x,
|
||||
|
@ -487,6 +510,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
DrawText(x, y, message, forecolor, backcolor, fontsize, fontfamily, fontstyle, horizalign, vertalign);
|
||||
}
|
||||
|
||||
[LuaMethodExample("drawText", "gui.drawText( 16, 32, \"Some message\", 0x7F0000FF, 0x00007FFF, 8, \"Arial Narrow\", \"bold\", \"center\", \"middle\" );")]
|
||||
[LuaMethod("drawText", "Draws the given message in the emulator screen space (like all draw functions) at the given x,y coordinates and the given color. The default color is white. A fontfamily can be specified and is monospace generic if none is specified (font family options are the same as the .NET FontFamily class). The fontsize default is 12. The default font style is regular. Font style options are regular, bold, italic, strikethrough, underline. Horizontal alignment options are left (default), center, or right. Vertical alignment options are bottom (default), middle, or top. Alignment options specify which ends of the text will be drawn at the x and y coordinates.")]
|
||||
public void DrawText(
|
||||
int x,
|
||||
|
@ -582,6 +606,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("pixelText", "gui.pixelText( 16, 32, \"Some message\", 0x7F0000FF, 0x00007FFF, \"Arial Narrow\" );")]
|
||||
[LuaMethod("pixelText", "Draws the given message in the emulator screen space (like all draw functions) at the given x,y coordinates and the given color. The default color is white. Two font families are available, \"fceux\" and \"gens\" (or \"0\" and \"1\" respectively), both are monospace and have the same size as in the emulaors they've been taken from. If no font family is specified, it uses \"gens\" font, unless that's overridden via gui.defaultPixelFont()")]
|
||||
public void DrawText(
|
||||
int x,
|
||||
|
@ -636,6 +661,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("text", "gui.text( 16, 32, \"Some message\", 0x7F0000FF, \"bottomleft\" );")]
|
||||
[LuaMethod("text", "Displays the given text on the screen at the given coordinates. Optional Foreground color. The optional anchor flag anchors the text to one of the four corners. Anchor flag parameters: topleft, topright, bottomleft, bottomright")]
|
||||
public void Text(
|
||||
int x,
|
||||
|
@ -677,6 +703,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
GlobalWin.OSD.AddGUIText(message, x, y, Color.Black, forecolor ?? Color.White, a);
|
||||
}
|
||||
|
||||
[LuaMethodExample("createcanvas", "local nlguicre = gui.createcanvas( 77, 99, 2, 48 );")]
|
||||
[LuaMethod("createcanvas", "Creates a canvas of the given size and, if specified, the given coordinates.")]
|
||||
public LuaTable Text(int width, int height, int? x = null, int? y = null)
|
||||
{
|
||||
|
|
|
@ -17,6 +17,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public override string Name => "input";
|
||||
|
||||
[LuaMethodExample("get", "local nlinpget = input.get( );")]
|
||||
[LuaMethod("get", "Returns a lua table of all the buttons the user is currently pressing on their keyboard and gamepads\nAll buttons that are pressed have their key values set to true; all others remain nil.")]
|
||||
public LuaTable Get()
|
||||
{
|
||||
|
@ -29,6 +30,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
return buttons;
|
||||
}
|
||||
|
||||
[LuaMethodExample("getmouse", "local nlinpget = input.getmouse( );")]
|
||||
[LuaMethod("getmouse", "Returns a lua table of the mouse X/Y coordinates and button states. Table keys are X, Y, Left, Middle, Right, XButton1, XButton2, Wheel.")]
|
||||
public LuaTable GetMouse()
|
||||
{
|
||||
|
|
|
@ -17,6 +17,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public override string Name => "savestate";
|
||||
|
||||
[LuaMethodExample("load", "savestate.load( \"C:\\state.bin\" );")]
|
||||
[LuaMethod("load", "Loads a savestate with the given path")]
|
||||
public void Load(string path)
|
||||
{
|
||||
|
@ -30,6 +31,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("loadslot", "savestate.loadslot( 7 );")]
|
||||
[LuaMethod("loadslot", "Loads the savestate at the given slot number (must be an integer between 0 and 9)")]
|
||||
public void LoadSlot(int slotNum)
|
||||
{
|
||||
|
@ -39,12 +41,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample("save", "savestate.save( \"C:\\state.bin\" );")]
|
||||
[LuaMethod("save", "Saves a state at the given path")]
|
||||
public void Save(string path)
|
||||
{
|
||||
GlobalWin.MainForm.SaveState(path, path, true);
|
||||
}
|
||||
|
||||
[LuaMethodExample("saveslot", "savestate.saveslot( 7 );")]
|
||||
[LuaMethod("saveslot", "Saves a state at the given save slot (must be an integer between 0 and 9)")]
|
||||
public void SaveSlot(int slotNum)
|
||||
{
|
||||
|
|
|
@ -33,6 +33,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"setTitle",
|
||||
"LuaCanvas.setTitle( \"Title\" );")]
|
||||
[LuaMethod(
|
||||
"setTitle",
|
||||
"Sets the canvas window title")]
|
||||
|
@ -41,6 +44,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
Text = title;
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"setLocation",
|
||||
"LuaCanvas.setLocation( 16, 32 );")]
|
||||
[LuaMethod(
|
||||
"setLocation",
|
||||
"Sets the location of the canvas window")]
|
||||
|
@ -51,6 +57,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
Top = (int)y;
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"clear",
|
||||
"LuaCanvas.clear( 0x000000FF );")]
|
||||
[LuaMethod(
|
||||
"clear",
|
||||
"Clears the canvas")]
|
||||
|
@ -59,6 +68,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
luaPictureBox.Clear(color);
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"refresh",
|
||||
"LuaCanvas.refresh( );")]
|
||||
[LuaMethod(
|
||||
"refresh",
|
||||
"Redraws the canvas")]
|
||||
|
@ -67,6 +79,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
luaPictureBox.Refresh();
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"setDefaultForegroundColor",
|
||||
"LuaCanvas.setDefaultForegroundColor( 0x000000FF );")]
|
||||
[LuaMethod(
|
||||
"setDefaultForegroundColor",
|
||||
"Sets the default foreground color to use in drawing methods, white by default")]
|
||||
|
@ -75,6 +90,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
luaPictureBox.SetDefaultForegroundColor(color);
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"setDefaultBackgroundColor",
|
||||
"LuaCanvas.setDefaultBackgroundColor( 0x000000FF );")]
|
||||
[LuaMethod(
|
||||
"setDefaultBackgroundColor",
|
||||
"Sets the default background color to use in drawing methods, transparent by default")]
|
||||
|
@ -83,6 +101,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
luaPictureBox.SetDefaultBackgroundColor(color);
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"setDefaultTextBackground",
|
||||
"LuaCanvas.setDefaultTextBackground( 0x000000FF );")]
|
||||
[LuaMethod(
|
||||
"setDefaultTextBackground",
|
||||
"Sets the default backgroiund color to use in text drawing methods, half-transparent black by default")]
|
||||
|
@ -91,6 +112,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
luaPictureBox.SetDefaultTextBackground(color);
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"drawBezier",
|
||||
"LuaCanvas.drawBezier( { { 5, 10 }, { 10, 10 }, { 10, 20 }, { 5, 20 } }, 0x000000FF );")]
|
||||
[LuaMethod(
|
||||
"drawBezier",
|
||||
"Draws a Bezier curve using the table of coordinates provided in the given color")]
|
||||
|
@ -107,6 +131,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"drawBox",
|
||||
"LuaCanvas.drawBox( 16, 32, 162, 322, 0x007F00FF, 0x7F7F7FFF );")]
|
||||
[LuaMethod(
|
||||
"drawBox",
|
||||
"Draws a rectangle on screen from x1/y1 to x2/y2. Same as drawRectangle except it receives two points intead of a point and width/height")]
|
||||
|
@ -123,6 +150,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"drawEllipse",
|
||||
"LuaCanvas.drawEllipse( 16, 32, 77, 99, 0x007F00FF, 0x7F7F7FFF );")]
|
||||
[LuaMethod(
|
||||
"drawEllipse",
|
||||
"Draws an ellipse at the given coordinates and the given width and height. Line is the color of the ellipse. Background is the optional fill color")]
|
||||
|
@ -139,6 +169,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"drawIcon",
|
||||
"LuaCanvas.drawIcon( \"C:\\icon.ico\", 16, 32, 18, 24 );")]
|
||||
[LuaMethod(
|
||||
"drawIcon",
|
||||
"draws an Icon (.ico) file from the given path at the given coordinate. width and height are optional. If specified, it will resize the image accordingly")]
|
||||
|
@ -155,6 +188,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"drawImage",
|
||||
"LuaCanvas.drawImage( \"C:\\image.bmp\", 16, 32, 18, 24, false );")]
|
||||
[LuaMethod(
|
||||
"drawImage",
|
||||
"draws an image file from the given path at the given coordinate. width and height are optional. If specified, it will resize the image accordingly")]
|
||||
|
@ -169,6 +205,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
luaPictureBox.DrawImage(path, x, y, width, height, cache);
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"clearImageCache",
|
||||
"LuaCanvas.clearImageCache( );")]
|
||||
[LuaMethod(
|
||||
"clearImageCache",
|
||||
"clears the image cache that is built up by using gui.drawImage, also releases the file handle for cached images")]
|
||||
|
@ -177,6 +216,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
luaPictureBox.ClearImageCache();
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"drawImageRegion",
|
||||
"LuaCanvas.drawImageRegion( \"C:\\image.png\", 11, 22, 33, 44, 21, 43, 34, 45 );")]
|
||||
[LuaMethod(
|
||||
"drawImageRegion",
|
||||
"draws a given region of an image file from the given path at the given coordinate, and optionally with the given size")]
|
||||
|
@ -191,6 +233,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
luaPictureBox.DrawImageRegion(path, source_x, source_y, source_width, source_height, dest_x, dest_y, dest_width, dest_height);
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"drawLine",
|
||||
"LuaCanvas.drawLine( 161, 321, 162, 322, 0xFFFFFFFF );")]
|
||||
[LuaMethod(
|
||||
"drawLine",
|
||||
"Draws a line from the first coordinate pair to the 2nd. Color is optional (if not specified it will be drawn black)")]
|
||||
|
@ -199,6 +244,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
luaPictureBox.DrawLine(x1, y1, x2, y2, color);
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"drawAxis",
|
||||
"LuaCanvas.drawAxis( 16, 32, int size, 0xFFFFFFFF );")]
|
||||
[LuaMethod(
|
||||
"drawAxis",
|
||||
"Draws an axis of the specified size at the coordinate pair.)")]
|
||||
|
@ -207,6 +255,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
luaPictureBox.DrawAxis(x, y, size, color);
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"drawArc",
|
||||
"LuaCanvas.drawArc( 16, 32, 77, 99, 180, 90, 0x007F00FF );")]
|
||||
[LuaMethod(
|
||||
"drawArc",
|
||||
"draws a Arc shape at the given coordinates and the given width and height"
|
||||
|
@ -216,6 +267,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
luaPictureBox.DrawArc(x, y, width, height, startangle, sweepangle, line);
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"drawPie",
|
||||
"LuaCanvas.drawPie( 16, 32, 77, 99, 180, 90, 0x007F00FF, 0x7F7F7FFF );")]
|
||||
[LuaMethod(
|
||||
"drawPie",
|
||||
"draws a Pie shape at the given coordinates and the given width and height")]
|
||||
|
@ -232,6 +286,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
luaPictureBox.DrawPie(x, y, width, height, startangle, sweepangle, line, background);
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"drawPixel",
|
||||
"LuaCanvas.drawPixel( 16, 32, 0xFFFFFFFF );")]
|
||||
[LuaMethod(
|
||||
"drawPixel",
|
||||
"Draws a single pixel at the given coordinates in the given color. Color is optional (if not specified it will be drawn black)")]
|
||||
|
@ -248,6 +305,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"drawPolygon",
|
||||
"LuaCanvas.drawPolygon( { 10, 0x007F00FF, 0x7F7F7FFF );")]
|
||||
[LuaMethod(
|
||||
"drawPolygon",
|
||||
"Draws a polygon using the table of coordinates specified in points. This should be a table of tables(each of size 2). Line is the color of the polygon. Background is the optional fill color")]
|
||||
|
@ -265,6 +325,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
|
||||
[LuaMethodExample(
|
||||
"drawRectangle",
|
||||
"LuaCanvas.drawRectangle( 16, 32, 77, 99, 0x007F00FF, 0x7F7F7FFF );")]
|
||||
[LuaMethod(
|
||||
"drawRectangle",
|
||||
"Draws a rectangle at the given coordinate and the given width and height. Line is the color of the box. Background is the optional fill color")]
|
||||
|
@ -273,6 +336,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
luaPictureBox.DrawRectangle(x, y, width, height, line, background);
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"drawString",
|
||||
"LuaCanvas.drawString( 16, 32, \"Some message\", 0x7F0000FF, 0x00007FFF, 8, \"Arial Narrow\", \"bold\", \"center\", \"middle\" );")]
|
||||
[LuaMethod(
|
||||
"drawString",
|
||||
"Alias of DrawText()")]
|
||||
|
@ -291,6 +357,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
luaPictureBox.DrawText(x, y, message, forecolor, backcolor, fontsize, fontfamily, fontstyle, horizalign, vertalign);
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"drawText",
|
||||
"LuaCanvas.drawText( 16, 32, \"Some message\", 0x7F0000FF, 0x00007FFF, 8, \"Arial Narrow\", \"bold\", \"center\", \"middle\" );")]
|
||||
[LuaMethod(
|
||||
"drawText",
|
||||
"Draws the given message at the given x,y coordinates and the given color. The default color is white. A fontfamily can be specified and is monospace generic if none is specified (font family options are the same as the .NET FontFamily class). The fontsize default is 12. The default font style is regular. Font style options are regular, bold, italic, strikethrough, underline. Horizontal alignment options are left (default), center, or right. Vertical alignment options are bottom (default), middle, or top. Alignment options specify which ends of the text will be drawn at the x and y coordinates.")]
|
||||
|
@ -311,6 +380,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
|
||||
// It'd be great if these were simplified into 1 function, but I cannot figure out how to return a LuaTable from this class
|
||||
[LuaMethodExample(
|
||||
"getMouseX",
|
||||
"local inLuaget = LuaCanvas.getMouseX( );")]
|
||||
[LuaMethod(
|
||||
"getMouseX",
|
||||
"Returns an integer representation of the mouse X coordinate relative to the canvas window.")]
|
||||
|
@ -320,6 +392,9 @@ namespace BizHawk.Client.EmuHawk
|
|||
return position.X;
|
||||
}
|
||||
|
||||
[LuaMethodExample(
|
||||
"getMouseY",
|
||||
"local inLuaget = LuaCanvas.getMouseY( );")]
|
||||
[LuaMethod(
|
||||
"getMouseY",
|
||||
"Returns an integer representation of the mouse Y coordinate relative to the canvas window.")]
|
||||
|
|
Loading…
Reference in New Issue