Handler
CancellableEvent
CancellableEvent(engine: Engine)
Bases: Event
Base cancellable event implementation for wame plugins.
LifetimeEvent
LifetimeEvent(engine: Engine)
LoadEvent
LoadEvent(engine: Engine)
UnloadEvent
UnloadEvent(engine: Engine)
SceneEvent
SceneEvent(engine: Engine)
IntVector2
Bases: BaseVector2
2D Integer Vector Array.
Create a new 2D, int-based vector array.
| PARAMETER | DESCRIPTION |
|---|---|
x
|
Coordinate on the X-axis.
TYPE:
|
y
|
Coordinate on the Y-axis.
TYPE:
|
magnitude
magnitude() -> float
Calculate the magnitude of this vector.
| RETURNS | DESCRIPTION |
|---|---|
float
|
The magnitude of this vector. |
copy
copy() -> IntVector2
Copy this vector into another instance of the same vector.
| RETURNS | DESCRIPTION |
|---|---|
IntVector2
|
This vector as another instance. |
dot
dot(other: IntVector2) -> float
Calculate the dot product of this vector with another.
| PARAMETER | DESCRIPTION |
|---|---|
other
|
The other vector to calculate the dot product with.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
The dot product of these two vectors. |
from_iterable
classmethod
from_iterable(
iterable: Union[
IntVector2,
np.ndarray[np.int32],
tuple[int, int],
list[int],
],
) -> IntVector2
Create a new 2D, int-based vector array from an iterable with 2 int values.
| PARAMETER | DESCRIPTION |
|---|---|
iterable
|
The iterable with 2
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
IntVector2
|
The new 2D, |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the provided iterable contains more or less than 2 values |
normalize
normalize() -> FloatVector2
Normalize this vector.
| RETURNS | DESCRIPTION |
|---|---|
FloatVector2
|
The normalized vector. |
| RAISES | DESCRIPTION |
|---|---|
ZeroDivisionError
|
If the magnitude of this vector is 0 |
to_numpy
Return this vector as an instance of a NumPy array.
| PARAMETER | DESCRIPTION |
|---|---|
copy
|
If this method should return a copy of the internal
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
numpy.ndarray[numpy.int32]
|
This vector as an instance of a |
Warning
If you return the array itself, any changes to that array will change this vector object.
JoystickEvent
JoystickEvent(engine: Engine)
Bases: SceneEvent, CancellableEvent
Base joystick event implementation.
cancel
cancel() -> None
Cancel this event from being further handled.
JoystickAxisMotionEvent
JoystickAxisMotionEvent(engine: Engine)
Bases: JoystickEvent
Dispatched when the scene recognizes movement in a joystick axis.
cancel
cancel() -> None
Cancel this event from being further handled.
JoystickButtonDownEvent
JoystickButtonDownEvent(engine: Engine)
Bases: JoystickEvent
Dispatched when the scene recognizes that a button has been pressed on a joystick.
cancel
cancel() -> None
Cancel this event from being further handled.
JoystickButtonUpEvent
JoystickButtonUpEvent(engine: Engine)
Bases: JoystickEvent
Dispatched when the scene recognizes that a button has been released on a joystick.
cancel
cancel() -> None
Cancel this event from being further handled.
JoystickDeviceAddedEvent
JoystickDeviceAddedEvent(engine: Engine)
Bases: JoystickEvent
Dispatched when the scene recognizes that a joystick device has been added to the system.
cancel
cancel() -> None
Cancel this event from being further handled.
JoystickDeviceRemovedEvent
JoystickDeviceRemovedEvent(engine: Engine)
Bases: JoystickEvent
Dispatched when the scene recognizes that a joystick device has been removed from the system.
cancel
cancel() -> None
Cancel this event from being further handled.
JoystickHatMotionEvent
JoystickHatMotionEvent(engine: Engine)
Bases: JoystickEvent
Dispatched when the scene recognizes that the hat of a joystick has moved.
cancel
cancel() -> None
Cancel this event from being further handled.
KeyEvent
KeyEvent(engine: Engine)
Bases: SceneEvent, CancellableEvent
Base key event implementation.
mods
property
mods: int
The bitwise-combined keycodes of all modification keys pressed at the time of this event.
cancel
cancel() -> None
Cancel this event from being further handled.
KeyPressedEvent
KeyPressedEvent(engine: Engine)
KeyPressingEvent
KeyPressingEvent(engine: Engine)
KeyReleasedEvent
KeyReleasedEvent(engine: Engine)
MouseEvent
MouseEvent(engine: Engine)
Bases: SceneEvent, CancellableEvent
Base mouse event implementation.
cancel
cancel() -> None
Cancel this event from being further handled.
MouseMoveEvent
MouseMoveEvent(engine: Engine)
Bases: MouseEvent
Dispatched when the scene recognizes that the mouse has moved.
cancel
cancel() -> None
Cancel this event from being further handled.
MousePressedEvent
MousePressedEvent(engine: Engine)
Bases: MouseEvent
Dispatched when the scene recognizes that a button on the mouse has been pressed.
cancel
cancel() -> None
Cancel this event from being further handled.
MouseReleasedEvent
MouseReleasedEvent(engine: Engine)
Bases: MouseEvent
Dispatched when the scene recognizes that a button on the mouse has been released.
cancel
cancel() -> None
Cancel this event from being further handled.
MouseWheelScrollEvent
MouseWheelScrollEvent(engine: Engine)
Bases: MouseEvent
Dispatched when the scene recognizes that the scroll wheel on the mouse has moved.
amount
property
amount: int
The amount the scroll wheel has moved - Positive if up, negative if down.
cancel
cancel() -> None
Cancel this event from being further handled.
CleanupEvent
CleanupEvent(engine: Engine)
Bases: SceneEvent
Dispatched when the scene is about to clean up.
FirstEvent
FirstEvent(engine: Engine)
Bases: SceneEvent
Dispatched when the scene is about to begin the game loop.
FixedUpdateEvent
FixedUpdateEvent(engine: Engine)
Bases: SceneEvent
Dispatched when the scene is about to run the fixed update cycle.
InitEvent
InitEvent(engine: Engine)
UserEvent
UserEvent(engine: Engine)
Bases: SceneEvent, CancellableEvent
Dispatched when the scene recognizes that a custom, developer-defined event has been fired.
cancel
cancel() -> None
Cancel this event from being further handled.
RenderEvent
RenderEvent(engine: Engine)
Bases: SceneEvent
Dispatched when the engine flags your plugin to render.
UpdateEvent
UpdateEvent(engine: Engine)
Bases: SceneEvent
Dispatched when the engine flags your plugin to update.
WindowCloseEvent
WindowCloseEvent(engine: Engine)
Bases: WindowEvent
Dispatched when the scene recognizes that the window has closed.
WindowDisplayChangedEvent
WindowDisplayChangedEvent(engine: Engine)
Bases: WindowEvent
Dispatched when the scene recognizes that the window's display has changed.
WindowFocusGainedEvent
WindowFocusGainedEvent(engine: Engine)
Bases: WindowEvent
Dispatched when the scene recognizes that the window has gained focus.
WindowFocusLostEvent
WindowFocusLostEvent(engine: Engine)
Bases: WindowEvent
Dispatched when the scene recognizes that the window has lost focus.
WindowHiddenEvent
WindowHiddenEvent(engine: Engine)
Bases: WindowEvent
Dispatched when the scene recognizes that the window has been hidden.
WindowMaximizedEvent
WindowMaximizedEvent(engine: Engine)
Bases: WindowEvent
Dispatched when the scene recognizes that the window has been maximized.
WindowMinimizedEvent
WindowMinimizedEvent(engine: Engine)
Bases: WindowEvent
Dispatched when the scene recognizes that the window has been minimized.
WindowMouseEnterEvent
WindowMouseEnterEvent(engine: Engine)
Bases: WindowEvent
Dispatched when the scene recognizes that the mouse has entered the window.
WindowMouseLeaveEvent
WindowMouseLeaveEvent(engine: Engine)
Bases: WindowEvent
Dispatched when the scene recognizes that the mouse has left the window.
WindowMovedEvent
WindowMovedEvent(engine: Engine)
WindowResizeEvent
WindowResizeEvent(engine: Engine)
WindowRestoredEvent
WindowRestoredEvent(engine: Engine)
Bases: WindowEvent
Dispatched when the scene recognizes that the window has been restored.
WindowShownEvent
WindowShownEvent(engine: Engine)
Bases: WindowEvent
Dispatched when the scene recognizes that the window has been shown.
on_event
on_event(
event: type[Event],
execution: ExecutionStep = ExecutionStep.AFTER,
) -> Callable[[Any], None]
Register a plugin to listen to a specific event at a desired execution step. Use as a decorator in a plugin implementation.
| PARAMETER | DESCRIPTION |
|---|---|
event
|
Any
TYPE:
|
execution
|
The desired time in which this event will be fired for the plugin to handle.
TYPE:
|