User Tools

Site Tools


crpl:docs:pixeltocell

<- CRPL reference <- Screen Commands

PixelToCell

ArgumentsResultNotation
Coordinates of a pixelCoordinates of the corresponding cellx1 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 div or 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
crpl/docs/pixeltocell.txt · Last modified: 2021/02/05 11:44 by Karsten75