GUI Events
- class arcade.gui.UIEvent(source: Any)[source]
Bases:
An event created by the GUI system.
Can be passed as follows:
widget.dispatch("on_event", event)
An event always has a source. This is the UIManager for general input events, but will be the specific widget in case of events like click events.
- Parameters:
source – The source of the event.
- class arcade.gui.UIMouseEvent(source: Any, x: int, y: int)[source]
Bases:
UIEvent
Base class for all UI mouse events.
- Parameters:
x – The x coordinate of the mouse.
y – The y coordinate of the mouse.
- class arcade.gui.UIMouseMovementEvent(source: Any, x: int, y: int, dx: int, dy: int)[source]
Bases:
UIMouseEvent
Triggered when the mouse is moved.
- Parameters:
dx – The change in x coordinate.
dy – The change in y coordinate.
- class arcade.gui.UIMousePressEvent(source: Any, x: int, y: int, button: int, modifiers: int)[source]
Bases:
UIMouseEvent
Triggered when a mouse button(left, right, middle) is pressed.
- Parameters:
button – The button pressed.
modifiers – The modifiers pressed.
- class arcade.gui.UIMouseDragEvent(source: Any, x: int, y: int, dx: int, dy: int, buttons: int, modifiers: int)[source]
Bases:
UIMouseEvent
Triggered when the mouse moves while one of its buttons being pressed.
- Parameters:
dx – The change in x coordinate.
dy – The change in y coordinate.
buttons – The buttons pressed.
modifiers – The modifiers pressed.
- class arcade.gui.UIMouseReleaseEvent(source: Any, x: int, y: int, button: int, modifiers: int)[source]
Bases:
UIMouseEvent
Triggered when a mouse button is released.
- Parameters:
button – The button released.
modifiers – The modifiers pressed
- class arcade.gui.UIMouseScrollEvent(source: Any, x: int, y: int, scroll_x: int, scroll_y: int)[source]
Bases:
UIMouseEvent
Triggered by rotating the scroll wheel on the mouse.
- Parameters:
scroll_x – The horizontal scroll amount.
scroll_y – The vertical scroll
- class arcade.gui.UIKeyEvent(source: Any, symbol: int, modifiers: int)[source]
Bases:
UIEvent
Base class for all keyboard-centric UI events.
- Parameters:
symbol – The key pressed.
modifiers – The modifiers pressed.
- class arcade.gui.UIKeyPressEvent(source: Any, symbol: int, modifiers: int)[source]
Bases:
UIKeyEvent
Triggered when a key is pressed.
- class arcade.gui.UIKeyReleaseEvent(source: Any, symbol: int, modifiers: int)[source]
Bases:
UIKeyEvent
Triggered when a key is released.
- class arcade.gui.UITextEvent(source: Any)[source]
Bases:
UIEvent
Base class for text-related events.
It holds no data of its own.
- class arcade.gui.UITextInputEvent(source: Any, text: str)[source]
Bases:
UITextEvent
Triggered whenever the user inputs any text.
Usually, this will be after
UIKeyPressEvent
and before aUIKeyReleaseEvent
. It may also occur when:the user holds down a key to repeat letters or spaces
a platform-specific input method, such as pen input on a tablet PC
To learn more, see pyglet’s relevant documentation.
- Parameters:
text – The text inputted. Often a single character.
- class arcade.gui.UITextMotionEvent(source: Any, motion: Any)[source]
Bases:
UITextEvent
Triggered when text cursor moves.
- Parameters:
motion – The motion of the cursor
- class arcade.gui.UITextMotionSelectEvent(source: Any, selection: Any)[source]
Bases:
UITextEvent
Triggered when the text cursor moves selecting the text with it.
- Parameters:
selection – The selection of the cursor
- class arcade.gui.UIOnClickEvent(source: Any, x: int, y: int, button: int, modifiers: int)[source]
Bases:
UIMouseEvent
Triggered when a widget is clicked.
- Parameters:
button – The button clicked.
modifiers – The modifiers pressed.
- class arcade.gui.UIOnUpdateEvent(source: Any, dt: int)[source]
Bases:
UIEvent
Arcade on_update callback passed as
UIEvent
.- Parameters:
dt – Time since last update