# info
  • home
  • gallery
  • gallery
  • screenshots
  • downloads
  • news
# how to
  • tutorials
  • reference
  • forum
  • links

Tutorials

These tutorials are also available as a pdf file.

You can also refer to the NodeBox tutorial for more help and instruction on using Spryte.

the basics +

a few more basics +

logic +

animate & interact +

libraries +

advanced +

compositing +

© info

console window

You have probably already noticed how a black console window pops-up every time you execute your code. It usually somewhere behind your visual output window. It reports back any errors your script may contain.

In this example, the rect() command has been improperly used; it requires four arguments/values, but only one has been provided (rect(10)):

rect() error

When the code is executed, both the visual output and console window pop-up. However, the rectangle is not rendered due to the error; and, because of this, neither is the white background (background(1)):

rect() error outputs

Moving the visual output window reveals the error message in the console window. You may, at first, find these messages somewhat cryptic, but you will come to find them very useful as you get to understand them better. The first four lines in this output can be ignored, but the last two point out the error at hand:

rect() error message

In this case, the error you are interested in reads:


  File "shoebot_code", line 3, in <module>
TypeError: rect() takes at least 5 arguments (2 given)

error explanation

First off, take note of the line which reads:
File "shoebot_code", line 3, in <module>
This indicates where there is an error -- in this case, on line 3 (where the "rect(10)" is written).

Now, take note of the next line which reads:
TypeError: rect() takes at least 5 arguments (2 given)
This indicates why there is an error.

The "rect(10)" line is producing an error because the rect() command requires four different user-specified arguments/values. To remind you of them, the rect() code hint specifies:
rect (x, y, width, height, roundness=0.0, draw=True)

From this code hint, it can be established that the last two arguments -- roundness=0.0 and draw=True -- are optional. This is because they have = signs in them that indicate what default value will substituted should you not provide the respective argument. In other words, if you write the command:
rect(10, 10, 50, 60)
you are effectively writing:
rect(10, 10, 50, 60, 0.0, True)
To overide these default values, you could write something like:
rect(10, 10, 50, 60, 0.5, False)

Anyhow, back to the error. It states that you have provided too few arguments, meaning that you must provide more:


rect() takes at least 5 arguments (2 given)

* You have probably realised that the error states that rect() takes 5 arguments, and I have told you it requires 4. Without getting too technical, there will always be one more than you need.