AudioAsset
Ease
FastString
FontAsset
NineSlice
PackedSprite
PackedSpriteID
RB
   HardwareSettings
   IRetroBlitGame
RBAsset
Rect2i
ShaderAsset
SoundReference
SpriteGrid
SpriteSheetAsset
TMXMapAsset
   TMXLayer
   TMXLayerLoadState
   TMXObject
   TMXObjectGroup
   TMXProperties
Vector2i

RB.PointerPos

Method  -  Static

public static Vector2i PointerPos(int pointerIndex = 0)

Parameters

pointerIndex int Index of the pointer position to get

Returns

Vector2i

Pointer position

Description

Returns the current pointer position in game display coordinates. If pointerIndex is not specified then the mouse position, or first finger touch is returned. Alternatively, pointerIndex value of 0 to 3 can be specified to query a specific finger touch position.

If there is no mouse connected, and there are no active touches then the position is undefined. See RB.PointerPosValid for checking if the pointer position is valid.

Pointer button states can be checked with RB.ButtonDown, RB.ButtonPressed, and RB.ButtonReleased.

Example

void Render() {
    if (RB.PointerPosValid()) {
        RB.DrawSprite("pointer"RB.PointerPos());
    }
}

See Also

RB.PointerPosValid
RB.PointerScrollDelta
RB.ButtonDown
RB.ButtonPressed
RB.ButtonReleased

See Docs

Features - Pointer
Features - Multi-touch Support