Skip to content
Narta Xaymar Dirks edited this page Oct 30, 2026 · 7 revisions

Blitz3DBlitzPlusBlitzBasic

MouseX

MouseX:Int32

Returns: The horizontal position of the pointer.

Description

The horizontal position of the pointer in the graphics buffer, from 0 on the left to GraphicsWidth() - 1. When the window is scaled, the position is converted back to buffer pixels. MoveMouse sets it. BlitzPlus programs can also pass a canvas handle to get the position relative to that canvas.

Differences

  • The Device argument is a BlitzLLVM extension: the original has no such argument and only knows one mouse.

Examples

Graphics 320, 240, 0, 2
SetBuffer BackBuffer()
MoveMouse 200, 90
Cls
Color 255, 255, 255
Line MouseX(), 0, MouseX(), 239
Line 0, MouseY(), 319, MouseY()
Text 10, 10, "MouseX = " + MouseX()
Text 10, 24, "MouseY = " + MouseY()
Flip
WaitKey

Media

MouseX

Related Commands

MouseChanged, MouseDeviceConnected, MouseDeviceCount, MouseDeviceName, MouseDown, MouseHit, MouseWait, MouseXSpeed

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally