Returns current mouse cursor Y coordinate in window space.
Takes no parameters.
Returns integer Y position (vertical pixel coordinate, 0=top edge of window).
Input
Parameters & Returns
Parameters
This function takes no parameters.
Returns
Int
Quick Summary
Returns current mouse cursor Y coordinate in window space.
Takes no parameters.
Returns integer Y position (vertical pixel coordinate, 0=top edge of window).
Technical Exegesis...
Returns current mouse cursor Y coordinate in window space. Takes no parameters. Returns integer Y position (vertical pixel coordinate, 0=top edge of window). Queries mouse cursor position relative to window client area, updates automatically each frame.
Coordinate system: 0=top edge of window (minimum Y), increases downward (positive direction, standard screen coordinates), window height-1=bottom edge (maximum Y, e.g.
Returns current mouse cursor Y coordinate in window space. Takes no parameters. Returns integer Y position (vertical pixel coordinate, 0=top edge of window). Queries mouse cursor position relative to window client area, updates automatically each frame.
Coordinate system: 0=top edge of window (minimum Y), increases downward (positive direction, standard screen coordinates), window height-1=bottom edge (maximum Y, e.g., 1079 for 1080px window), coordinates in pixels (integer screen space), relative to window client area (excludes title bar and borders).
Use cases: (1) Cursor rendering (draw custom cursor at mouse position: b2dDrawImage(cursor, inpGetMouseX(), inpGetMouseY())), (2) UI interaction (check if mouse over button bounds), (3) Object selection (3D picking, ray cast from mouse position), (4) Camera control (mouse look, calculate pitch from vertical movement), (5) Drawing/painting tools (track mouse position for brush strokes).
Common patterns: cursor position = mouseX%=inpGetMouseX(): mouseY%=inpGetMouseY(); bounds check = If inpGetMouseY()>=buttonY AND inpGetMouseY()<buttonY+buttonHeight Then mouse over button; center offset = deltaY%=inpGetMouseY()-(windowHeight/2) (distance from center); coordinate conversion = worldY#=(inpGetMouseY()-cameraY)/zoom# (screen to world space).
Y-axis direction: Y increases downward (0=top, max=bottom), standard for screen coordinates (opposite of mathematical Y-axis), matches most 2D graphics APIs (DirectX, GDI, HTML canvas), different from OpenGL (OpenGL Y increases upward, may need conversion).
Window vs screen space: inpGetMouseY returns window-relative coordinates (0,0=top-left of window client area), not screen-absolute coordinates (monitor position), coordinates remain valid when window moved (always relative to window), coordinates adjust when window resized (may need to handle resize events).
Out of bounds: mouse can leave window (coordinates become invalid when cursor outside), coordinates may be negative or exceed window bounds (when cursor outside client area), check bounds if needed (If mouseY>=0 AND mouseY<windowHeight Then inside window), some systems clamp to window bounds (depends on OS and windowing mode).
Performance: very fast query (~0.0001ms, simple variable access), safe for per-frame calls (negligible overhead), no input polling required (system updates cursor position automatically).
Coordinate precision: returns integer pixels (no sub-pixel precision), for smoother mouse tracking use inpGetMouseYSpeed (delta movement), high-DPI displays handled by system (coordinates in logical pixels, not physical).
Fullscreen mode: coordinates relative to fullscreen window (0,0=top-left of screen in fullscreen), same coordinate system as windowed mode (consistent API regardless of display mode).