- [[crpl:crplreference| CRPL reference]] <- [[crpl:crplreference#screen_commands|Screen Commands]]
===== PixelToCell =====
^Arguments^Result^Notation^
|Coordinates of a pixel|Coordinates of the corresponding cell|''x1 y1 -- n1 n2''|
=== Description ===
Converts a pair of pixel coordinates into a pair of map cell coordinates.
The values returned by PixelToCell are **floats** and operations such as [[crpl:docs:div|div]] or [[crpl:docs:mul|mul]] will operate on floating point numbers.
To convert them to integers, this is one way:
<-pixelX <-pixelY PixelToCell asint swap asint swap ->cellY ->cellX
=== Examples ===
GetMousePosition PixelToCell
is equivalent to
GetMouseCell