PICO-8 Wiki
Edit Page
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

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 ==
Please note that all contributions to the PICO-8 Wiki are considered to be released under the CC-BY-SA
Cancel Editing help (opens in new window)