Starting Acron

Creating a New Acron Application

ShowBase

To start Acron, open the src/main.py of a project made by the launcher (see Installing Acron), or create any file with the .py extension in the project. Any text editor will work. Enter the following text into it:

from direct.showbase.ShowBase import ShowBase


class MyApp(ShowBase):

    def __init__(self):
        ShowBase.__init__(self)


app = MyApp()
app.run()

Here we made our main class inherit from ShowBase. This class loads most of the other Acron modules, and causes the 3D window to appear. The run() method contains the Acron main loop. It renders a frame, handles the background tasks, and then repeats. It does not normally return, so it needs to be called only once and must be the last line in your script. In this particular example, there will be nothing to render, so you should expect a window containing an empty purple area (the engine’s default background colour).

Running the Program

Press Run on the project’s page in the launcher, or, in a terminal in the project’s folder:

acronmanager run

acronmanager run runs the project’s main_file with the project’s own Python (see Running your Program). If Acron has been installed properly, a purple window titled Acron appears. There is nothing we can do with this window, but that will change shortly.