User Tools

Site Tools


crpl:docs:getmousescreenposition

<- CRPL reference <- Input Commands

GetMouseScreenPosition

ArgumentsResultNotation
X and Y relative coordinates of mouse – f1 f2

Description

Pushes the X then the Y coordinate of the mouse relative to the screen to the stack. 0,0 corresponds to the lower left corner of the screen, and 1,1 to the upper right corner of the screen. Note that the results can lie outside of this range if the mouse is outside the game window.

Added in 1.7.1.

Examples

# A CRPL core which moves to the cursor on click, and maintains its position on the screen
once
  SetScreenMode(TRUE)
endonce
if(GetMouseButtonDown(0))
  SetScreenCoords(GetMouseScreenPosition)
endif
crpl/docs/getmousescreenposition.txt · Last modified: 2021/02/05 11:44 by Karsten75