Posts for YourBoyMacDaddy

Post subject: Lua Documentation is slightly outdated (typo)
Joined: 2/5/2019
Posts: 1
Location: Colorado
The API docs for LuaCanvas has a capitalization error. The methods under LuaCanvas found at http://tasvideos.org/Bizhawk/LuaFunctions.html Here is the code that should work.
canv = gui.createcanvas(600,600)

--Works
canv.DrawBox(6,15,100,100, "red" )
canv.DrawText(10,65, "you CAN see me :) ")
canv.SetTitle("title test")

--Fails, but shouldn't according to the docs
canv.drawBox(10,25,100,100, "green" )
canv.drawText(10,60, "you wont see me :( ")
canv.setTitle("NEW title test")
Output: https://imgur.com/a/jlcbAIS After fixing it. Capitalize the D's and the S
canv = gui.createcanvas(600,600)

--Works
canv.DrawBox(6,15,100,100, "red" )
canv.DrawText(10,65, "you CAN see me :) ")
canv.SetTitle("title test")

--Works now!
canv.DrawBox(10,25,100,100, "green" )
canv.DrawText(10,60, "you wont see me :( ")
canv.SetTitle("NEW title test")
Output: https://i.imgur.com/sjivwAI.png So. Look into the source code, everything is fine, but as you can tell, "LuaCanvas.DrawBox" has a capital D: Bizhawk.Client.Emuhawk/tools/Lua/LuaCanvas.cs
		[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)
		{
I'm your boy!!!