Post subject: LUA Gui Canvas
Joined: 7/8/2015
Posts: 3
So I'm having an issue with BizHawk, I am able to create and use additional canvas's via the LUA command "gui.createcanvas(canvasSize, canvasSize);" I can create rectangles, print text etc however I cannot find any documentation on what commands are available for the custom canvas's. I have been referencing the standard gui.xx commands and recognized that the drawrect and drawtext are same (with a capital D on draw) however I cannot figure out a command equivalent to "drawLine". Is there such a command for custom canvas's? Also is there any documentation on the custom canvas commands? Cheers Shane
Editor, Emulator Coder
Joined: 8/7/2008
Posts: 1156
https://github.com/TASVideos/BizHawk/blob/master/BizHawk.Client.EmuHawk/tools/Lua/LuaCanvas.cs Obviously it's half-baked. Kind of unfortunate that there's no way right now for them to spill into the automatic in-app documentation api search box I think it's a huge mistake for there to be any difference between the canvas functions and the gui drawing functions, but someone needed a canvas fast so they added this in
Joined: 7/8/2015
Posts: 3
Hi Zeromus, Cheers for the information, so say I pulled down the complete source from Git, updated the LuaCanvas.cs to include my own new functions and compiled the whole shindig I should be able to reference those new functions right? LuaCanvas.cs is coded in C# the same as the rest of the emulator correct? Cheers Shane
Joined: 7/8/2015
Posts: 3
ShaneCluning wrote:
Hi Zeromus, Cheers for the information, so say I pulled down the complete source from Git, updated the LuaCanvas.cs to include my own new functions and compiled the whole shindig I should be able to reference those new functions right? LuaCanvas.cs is coded in C# the same as the rest of the emulator correct? Cheers Shane
So in answer to my own question as I got to fiddling, yes you can add your own custom functions to the LuaCanvas.cs and I've added in DrawBox and DrawLine. For anyone who finds this later its as simple as following the instructions here http://tasvideos.org/Bizhawk/Compiling.html and once you're in the IDE it's easy enough to edit the LuaCanvas.cs (I just searched for it) and throw in your own functions. Compile away and you're golden.
Editor, Emulator Coder
Joined: 8/7/2008
Posts: 1156
now for the finishing touch, put it in your fork on github and send us a PR