🧪 Version 0.3.1 is our alpha release candidate. Please send us bug reports and suggestions!

Sketchingpy

Creative coding and interactive science everywhere for everyone: web, desktop, mobile, Jupyter, and more. Open source!

Reference for get_pointer_x

Get the x coordinate of the mouse pointer. This is part of the reference section.

Purpose

Get the current horizontal coordinate of the mouse pointer or, in the case of a touchscreen, the point of last touch input if available. Defaults to 0 if no mouse events have been seen.

Snippet

Get the current cursor x coordinate.
sketch.get_mouse().get_x()

Examples

Availability

Available for Sketch2DApp and Sketch2DWeb.

See also