User Tools

Site Tools


crpl:docs:pixeltocell

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
crpl:docs:pixeltocell [2014/12/20 01:30] – created stewbasiccrpl:docs:pixeltocell [2025/02/14 14:57] (current) – external edit 127.0.0.1
Line 1: Line 1:
-~~DISCUSSION~~+
 <- [[crpl:crplreference| CRPL reference]] <- [[crpl:crplreference#screen_commands|Screen Commands]] <- [[crpl:crplreference| CRPL reference]] <- [[crpl:crplreference#screen_commands|Screen Commands]]
 =====  PixelToCell  ===== =====  PixelToCell  =====
Line 9: Line 9:
 === Description === === Description ===
 Converts a pair of pixel coordinates into a pair of map cell coordinates. Converts a pair of pixel coordinates into a pair of map cell coordinates.
 +
 +<note important>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:
 +<code><-pixelX <-pixelY PixelToCell asint swap asint swap ->cellY ->cellX</code></note>
  
 === Examples === === Examples ===
crpl/docs/pixeltocell.1419039005.txt.gz · Last modified: 2025/02/14 14:56 (external edit)