Getting Started#
Installation#
Installing rubato is simple. Just run the following in a terminal:
$ pip install rubato
Note
On Windows and Mac, the dll files that SDL needs come pre-bundled with rubato, so you should be ready to go. On Linux only, you’ll need to install them yourself:
$ pip install pysdl2-dll
Setting Up#
Once you’ve installed rubato, setting up a new project is easy. To create a new blank project, simply create a new python file and type the following:
import rubato as rb
rb.init()
rb.init()
initializes rubato.
An optional dictionary argument passed into rb.init()
can specify such things as window size, resolution, background color, and more.
Note
Throughout our documentation, we assume that rubato is imported as rb
.
rubato documentation describes exactly what custom parameters you can specify when creating rubato objects or calling specific functions such as init()
.
Warning
You should only interact with rubato (adding scenes, game objects, etc.) AFTER calling init()
.
Now that rubato is ready, add the following line of code to the end of the file:
rb.begin()
rb.begin()
is the function that starts the rubato engine.
Without it, rubato won’t know to begin the engine cycle, and your game won’t run.
It is recommended to call rb.begin()
at the bottom of your project file as in this example.
Now run your code in a terminal using python3 YOUR_FILENAME.py
. If you see a white square window, congrats!
You’re officially up and running with rubato.
Note
Code not working? It’s possible something went wrong during the dependency installation process. Check your terminal log for errors and reinstall rubato and the SDL dlls if necessary.
you can jump straight into the full api documentation.