-
Notifications
You must be signed in to change notification settings - Fork 1
window
windowWrapper
is a soft wrapper around pyglet.window.Window. And simply adds additional functionality ontop, such as the ability to merge in sprites from different threads.
There's also different pages (or views) that you can add, delete or switch over between. For instance, a loading page, and then transition to a main view.
- width - sets the width of the window
- height - sets the height of the window
- fps - Shows or hides a built-in FPS counter.
Create a new page (buffer/batch), where you can add sprites to. Later on you can switch to this page/context by invoking swap_page(name)
.
Swap page/context to name
, this hides all previous elements and transitions to the new view with the elements associated to this view.
Create a new layer inside the current page. This is to be able to set sprites/objects behind or infront of each other. This is a extension of pyglet.grapahics.OrderedGroup
Deletes the layer with name
identifier. Does also remove all child items(?).
Can be called safely from a separate thread, this will setup the sprite_obj
in between rendering frames.
- name - The name of the sprite object
- sprite_obj - the pointer to the function/class that will be executed to initiate the sprite
- sprite_parameters - the parameters passed to
sprite_obj()
Add the sprite_obj
instance to the local sprite store with the identifier name
.
This sprite will be added to the current page
and the current default layer
.
called right after the window is initiated. Useful if you
need to access objects before the first render but after
they've all been setup by the __init__
Called every frame just before render()
is called.
Called every frame, this will re-render the window.
This is done at the maximum possible frame rate (currently no frame-limit is supported).
It will draw every batch in the current page
, but also every active sprite
not associated with a page.
Starts the endless loop keeping everything running (and flushing buffers etc)