Yes, but I'm not sure how far you can take it if things start getting complex. For example, a simple expression to display the current frame position in seconds for a Text+ control might look like this:
- Code: Select all
os.date("%M:%S",time/24)
where the frames per second value is hard-coded to 24. (If you are not familiar with the other expressions,
os.date() is a Lua method for formatting a time value and
time is a built-in variable which returns the current frame number)
You can instead name a variable to hold the fps value, but there are some rules:
- the variable name must be preceded by a colon where it is declared
- the variable declaration must be separated from the remaining code by a semi-colon
- you have to add a return statement to make the whole thing work
Same example using a variable:
- Code: Select all
:fps=24; return os.date("%M:%S",time/fps)
This stuff is
seriously badly documented - maybe others can improve or expand on this?