engine package¶
Submodules¶
engine.windows module¶
- class engine.windows.EditPygletWindow(refreshRate)¶
Bases:
engine.windows.PygletWindow- render()¶
- class engine.windows.PygletWindow(refreshRate)¶
Bases:
pyglet.window.BaseWindow- on_close()¶
The user attempted to close the window.
This event can be triggered by clicking on the “X” control box in the window title bar, or by some other platform-dependent manner.
The default handler sets has_exit to
True. In pyglet 1.1, if pyglet.app.event_loop is being used, close is also called, closing the window immediately.- Event
- on_draw()¶
The window contents must be redrawn.
The EventLoop will dispatch this event when the window should be redrawn. This will happen during idle time after any window events and after any scheduled functions were called.
The window will already have the GL context, so there is no need to call switch_to. The window’s flip method will be called after this event, so your event handler should not.
You should make no assumptions about the window contents when this event is triggered; a resize or expose event may have invalidated the framebuffer since the last time it was drawn.
New in version 1.1.
- Event
- on_key_press(key, modifiers)¶
A key on the keyboard was pressed (and held down).
In pyglet 1.0 the default handler sets has_exit to
Trueif theESCkey is pressed.In pyglet 1.1 the default handler dispatches the
on_close()event if theESCkey is pressed.- Parameters
- symbolint
The key symbol pressed.
- modifiersint
Bitwise combination of the key modifiers active.
- Event
- on_key_release(key, modifiers)¶
A key on the keyboard was released.
- Parameters
- symbolint
The key symbol pressed.
- modifiersint
Bitwise combination of the key modifiers active.
- Event
- on_mouse_motion(x, y, delta_x, delta_y)¶
The mouse was moved with no buttons held down.
- Parameters
- xint
Distance in pixels from the left edge of the window.
- yint
Distance in pixels from the bottom edge of the window.
- dxint
Relative X position from the previous mouse position.
- dyint
Relative Y position from the previous mouse position.
- Event
- on_mouse_press(x, y, button, modifiers)¶
A mouse button was pressed (and held down).
- Parameters
- xint
Distance in pixels from the left edge of the window.
- yint
Distance in pixels from the bottom edge of the window.
- buttonint
The mouse button that was pressed.
- modifiersint
Bitwise combination of any keyboard modifiers currently active.
- Event
- render()¶
- set_scene(scene)¶
- update(delta_time)¶