-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A few function ideas #5
Comments
At the moment, all default lua libraries are available to you, so things like splitting strings and random numbers are available (http://stackoverflow.com/questions/1426954/split-string-in-lua for splitting strings, http://lua-users.org/wiki/MathLibraryTutorial for random numbers). This may not be the case in the future though. We still don't have any text rendering functionality, but when we do I'll see if I can get width/height information for a string at whatever font. |
One catch I've run into is properly computing width and height in text that has things like linebreaks. That's not really hard, just a bit of a gotcha if you forget. |
Even if a function you want can already be done in Lua, you should still suggest it. At some point we will be sandboxing Lua, which means the user won't be able to use any Lua functions or libraries unless we explicitly allow it. |
Sorry if this is a bit off-topic, but has there been any discussion on function naming rules/schemes? Hopefully something more consistent than the current implement is formalised, as RPG Code is a bit PHPesque in the random function naming and argument orders. |
I recommend that the new language implementation follow Lua standards. RPGCode's conventions are a mash of VB, C/C++, JS etc... They're pretty inconsistent. |
Yes, Asimir is correct (RE: sandboxing) As for naming conventions, right now there are none lol. However it is very easy to change the names and ordering of arguments, so I don't think this is too big of an issue. Once we know what the bulk of the commands are going to be, we can decide how to organize/name them. |
I'm not sure how many of these can already be done in trans4 with lua, but I thought I'd put them here anyway.
clear([cnv])
getPixel(x, y, &r, &g, &b, [cnv])
getRes(&w, &h)
gettextheight(text)
gettextwidth(text)
pixelText(x, y, str, [cnv])
random(min, max)
split(str, delimiter, arr)
The text was updated successfully, but these errors were encountered: