Post by Atom on Aug 16, 2016 13:26:59 GMT
You can now run your Touch Lua programs on your computer, (Windows only) with little or no changes made to them. Right now it supports programs using draw and system library dating to Touch Lua 1.2 (before image and audio support were added) but I could update it further. Lua SQLite3, Lua Matrix and Lua Complex are not included. The library I use is love2d, which only supports Lua 5.1. That means some functions and libraries might not be included (bit32)
SUPPORT
SUPPORTED FUNCTIONS
UNSUPPORTED FUNCTIONS
AVAILABLE FONTS (by default)
AVAILABLE ALERTS (by default)
DOWNLOADS
Emulator v.0.1.1 (19/08/16) (lastest)
Emulator v.0.1.0 (16/08/16)
INSTALLATION AND USE
CHANGES YOU MIGHT HAVE TO MAKE
ADD FONTS / ALERTS
Some fonts from your device are matched with equivalent fonts found on computers. There are only 6 matched fonts by default and only Helvetica supports text with styles (bold, italic...). If you need to add new fonts, add the font file in res/font/ (needs to be .ttf) Then add a new match in config.lua:
If you need to add alerts, add the mp3 file in res/sound/. Could be useful to replace audio library for now?
SCREENSHOTS
Example program, comes with emulator
CHANGELOG
Please leave feedback!
If you want support for more recent functions or libraries, tell me how they work so I can implement them.
(I have no idea how they work because I can't update my Touch Lua, iOS 6)
SUPPORT
SUPPORTED FUNCTIONS
draw.setscreen() draw.settitle() draw.clear()
draw.getsize() draw.getport() draw.string()
draw.stringinrect() draw.point() draw.moveto()
draw.lineto() draw.line() draw.rect()
draw.fillrect() draw.circle() draw.fillcircle()
draw.arc() draw.fillarc() draw.ellipse()
draw.fillellipse() draw.polygon() draw.fillpolygon()
draw.star() draw.fillstar() draw.triangle()
draw.filltriangle() draw.roundedrect() draw.fillroundedrect()
draw.stringsize() draw.setfont() draw.setlinestyle()
draw.setantialias() draw.getantialias() draw.sleep()
draw.gettime() draw.refresh() draw.beginframe()
draw.endframe() draw.enablerefresh() draw.disablerefresh()
draw.waittouch() draw.tracktouches() draw.doevents()
draw.clearevents()
sys.print() sys.println() sys.clear()
sys.sleep() sys.alert() sys.gettime()
sys.input()
UNSUPPORTED FUNCTIONS
sys.dir() sys.locate()
AVAILABLE FONTS (by default)
Helvetica
Helvetica-Bold
Helvetica-Oblique
Helvetica-Light
Helvetica-BoldOblique
Helvetica-LightOblique
Times New Roman
Avenir
Chalkboard SE
Courier New
Verdana
AVAILABLE ALERTS (by default)
drop
dtfm0
neg
tink
tock
vib
DOWNLOADS
Emulator v.0.1.1 (19/08/16) (lastest)
Emulator v.0.1.0 (16/08/16)
INSTALLATION AND USE
- Download the emulator and save it in any directory (you don't need to have Lua installed)
- You can run example program by double-clicking on run.bat
- Open config.lua and adjust the settings (screen size, file run by default)
- To run your program, you can:
- Drag and drop your file to run.bat (if config.lua filename is empty)
- Edit config.lua and change file run by default and then run run.bat
- Open command line in the emulator directory and do "run <filename>"
- Press ESC to exit, +/- to change zoom, 0 to reset zoom and ENTER to change screen orientation
CHANGES YOU MIGHT HAVE TO MAKE
- Your program might be accessing or writing files, and they are going to be written in the main directory. If you want them to be in another directory, you'll have to change the path in your code.
- If it has a main game loop which does not contain draw.doevents(), you won't be able to zoom, change orientation or close your program with ESC. (only by closing with console or killing the task) This is because draw.doevents() is used to do the emulator events too. If you don't want to do your program events, just the emulator's, do draw.doevents(false)
- I recommend you add a short delay (10ms) between each frame to prevent CPU overload.
ADD FONTS / ALERTS
Some fonts from your device are matched with equivalent fonts found on computers. There are only 6 matched fonts by default and only Helvetica supports text with styles (bold, italic...). If you need to add new fonts, add the font file in res/font/ (needs to be .ttf) Then add a new match in config.lua:
["<device font>"] = "<filename.ttf>";
If you need to add alerts, add the mp3 file in res/sound/. Could be useful to replace audio library for now?
SCREENSHOTS
Example program, comes with emulator
CHANGELOG
==== EMULATOR v0.1.1 ==== (19/08/2016)
• Added support for
sys.input(), draw.clearevents()
• Fixed console closing after program ends
==== EMULATOR v0.1.0 ==== (16/08/2016)
• Added support for
draw.setscreen(), draw.settitle(), draw.clear(),
draw.getsize(), draw.getport(), draw.string(),
draw.stringinrect(), draw.point(), draw.moveto(),
draw.lineto(), draw.line(), draw.rect(),
draw.fillrect(), draw.circle(), draw.fillcircle(),
draw.arc(), draw.fillarc(), draw.ellipse(),
draw.fillellipse(), draw.polygon(), draw.fillpolygon(),
draw.star(), draw.fillstar(), draw.triangle(),
draw.filltriangle(), draw.roundedrect(), draw.fillroundedrect(),
draw.stringsize(), draw.setfont(), draw.setlinestyle(),
draw.setantialias(), draw.getantialias(), draw.sleep(),
draw.gettime(), draw.refresh(), draw.beginframe(),
draw.endframe(), draw.enablerefresh(), draw.disablerefresh(),
draw.waittouch(), draw.tracktouches(), draw.doevents(),
sys.print(), sys.println(), sys.clear(),
sys.sleep(), sys.alert(), sys.gettime().
• Added console
• Added zoom and orientation
Please leave feedback!
If you want support for more recent functions or libraries, tell me how they work so I can implement them.
(I have no idea how they work because I can't update my Touch Lua, iOS 6)