I am very new at scripting, and I am trying to make a start menu for at game.

I have made a py file which contain the main menu (The title of the game) It would be nice to have a button, which the player could press on to start the game.

I am considering, to use the DirectButton object. My question is when you use this object do you have to create a new class where you define the properties of the button and then call for it in the main menu file ? or is it possible to just make it a function and then call it in the main menu file?

It would be really nice to get some feedback regarding this dilemma

Cheers :smiley:

The DirectButton has its own methods of defining the properties. You can read about them in the manual in the direct gui section. Also, DirectButton inherits from nodepath so you will be able to perform all of the usual transformations on it as well.

To answer the question, you dont need to create a new class to create a direct button.