pyxen.input.mouse
Access mouse position, movement, and buttons.
mouse = pyxen.input.mouse
Properties
| Property | Type | Description |
|---|---|---|
present | bool | Platform supports mouse |
pos | Vector2 | Current mouse position |
delta | Vector2 | Movement since last frame |
Buttons
mouse.leftmouse.rightmouse.middle
Each is a Button object:
if mouse.left.pressed:
print("Clicked!")
Example: Dragging
if mouse.left.down:
pos = mouse.pos
player.x = pos.x
player.y = pos.y
Notes
- All properties are read-only
deltaresets every frame- Coordinates are in world/screen space depending on your engine mode