Edit Page
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 9: | Line 9: | ||
For example, the [[Spr|spr()]] function has three required arguments and four optional arguments: |
For example, the [[Spr|spr()]] function has three required arguments and four optional arguments: |
||
+ | <syntaxhighlight lang="Lua"> |
||
− | <pre> |
||
spr( n, x, y, [w,] [h,] [flip_x,] [flip_y] ) |
spr( n, x, y, [w,] [h,] [flip_x,] [flip_y] ) |
||
+ | </syntaxhighlight> |
||
− | </pre> |
||
This function can be called with three arguments, accepting the defaults for the others: |
This function can be called with three arguments, accepting the defaults for the others: |
||
+ | <syntaxhighlight lang="Lua"> |
||
− | <pre> |
||
spr(1, 60, 60) |
spr(1, 60, 60) |
||
+ | </syntaxhighlight> |
||
− | </pre> |
||
+ | |||
To specify a value for the <code>flip_x</code> argument, you must also specify <code>w</code> and <code>h</code>, even if you're using their default values: |
To specify a value for the <code>flip_x</code> argument, you must also specify <code>w</code> and <code>h</code>, even if you're using their default values: |
||
+ | <syntaxhighlight lang="Lua"> |
||
− | <pre> |
||
spr(1, 60, 60, 1, 1, true) |
spr(1, 60, 60, 1, 1, true) |
||
+ | </syntaxhighlight> |
||
− | </pre> |
||
== The game loop == |
== The game loop == |