<- [[crpl:crplreference| CRPL reference]] <- [[crpl:crplreference#input_commands|Input Commands]] ===== GetMouseScreenPixelPosition ===== ^Arguments^Result^Notation^ | |X and Y relative coordinates of mouse | '' -- f1 f2'' | === Description === Pushes the X then the Y pixel coordinate of the mouse relative to the screen to the stack. 0,0 corresponds to the lower left corner of the screen, and ScreenWidth, ScreenHeight 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. Note that the command [[crpl:docs:getmouseposition|GetMousePosition]] is similar, but measures from the lower left corner of the map in map pixels, which get smaller as the player zooms out. Unlike GetMousePosition, the results of this command won't change as the player zooms or pans. The outputs of this command are the outputs of [[crpl:docs:getmousescreenposition|GetMouseScreenPosition]] multiplied by [[crpl:docs:screenwidth|ScreenWidth]] and [[crpl:docs:screenheight|ScreenHeight]] respectively. 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)) SetScreenPixelCoords(GetMouseScreenPixelPosition) endif