Making a window:
To make a window, type in Window(), there aren’t any required parameters although you may want to set the size and colour, in which case it would be Window(displaySize=(sizeX,sizeY),colour=(rgb1,rgb2,rg3)) Please note that the rgb values must be between 0 and 1. In this case the window is set to the variable win.
win = Window(displaySize=(sizeX,sizeY),colour=(rgb1,rgb2,rgb3) Adding a Camera:
The camera is an important part of game engines as it allows the player to move around the environment(Camera will be fixed otherwise) to initialise this type in
Camera()
And set it to a variable in this case the variable is called camera
camera = Camera()
And then we can add it to the window
win.setCamera(camera)
Adding an Object:
To initialise an object, there are two required parameters, the vertexes and the shape. Initialise like so(the object is saved to the variable cube)
cube = Object(Shapes.Cube(),[1,1,1])
This will initialise the cube with the predefined vertexes as a cube and a scale of x: 1, y:1, z:1. Extra parameter is Type and that takes in draw type, the default type is wireframe. Define it like so
cube = Object(Shapes.Cube(),[1,1,1],Type=DRAWTYPE.SOLID)
This will draw it as a solid shape and allow you to later create textures. Add this object to the window for increased functionality.
win.addObj(cube)
Running the window:
To do this you type in win.run and its argument is func(optional) which allows you to make adjustments each frame. The default is
win.run()
But with a update function it looks like
win.run(func=lambda: update(win))
It is recommended to pass the window in so you can access things later on. An example is
def update(win,variables):
 cube.rotate([1,1,1])
 variables[‘x’] += 1
x = 0
win = Window()
cube = Object(Shapes.Cube(),[1,1,1])
variables = {‘x’:x}
win.addObj(cube)
win.run(win,variables)
Please note variables do not need to be passed in a dictionary if they are declared in the same scope.
Keyboard Reader:
*The keyboard reader will be deprecated in future versions
This allows you to read the keyboard and should be declared like so
k = KeyboardReader()
And should be added to the window. To do this type
win.addKeyboardReader(k)
To check if a key is pressed type
if win.keyboard_reader.update(“X”) == True:
pass
You can replace x with any key and pass can be replaced with other things.