Lua can have optional parameters in the middle of the parameter list because the function checks for the type of objects being passed in. So if the 4th parameter is a number, then it knows you’re passing in a width and height. If it sees a string there like “Helvetica” or native.systemFont, then it knows you did not pass a width, height in and then processes it as a string, number for the font and size.
Lua can have optional parameters in the middle of the parameter list because the function checks for the type of objects being passed in. So if the 4th parameter is a number, then it knows you’re passing in a width and height. If it sees a string there like “Helvetica” or native.systemFont, then it knows you did not pass a width, height in and then processes it as a string, number for the font and size.