OpenTTD Source: CursorVars Struct Reference

OpenTTD Source 14.0-beta3

Public Member Functions | Data Fields
CursorVars Struct Reference

Collection of variables for cursor-display and -animation. More...

`#include <gfx_type.h>`

## Public Member Functions
void | UpdateCursorPositionRelative (int delta_x, int delta_y)
| Update cursor position based on a relative change. More...
bool | UpdateCursorPosition (int x, int y)
| Update cursor position on mouse movement. More...

## Data Fields
Point | pos
| logical mouse position
Point | delta
| relative mouse movement in this tick
int | wheel
| mouse wheel movement
bool | fix_at
| mouse is moving, but cursor is not (used for scrolling)
int | v_wheel
int | h_wheel
PalSpriteID | sprite_seq [16]
| current image of cursor
Point | sprite_pos [16]
| relative position of individual sprites
uint | sprite_count
| number of sprites to draw
Point | total_offs
Point | total_size
| union of sprite properties
Point | draw_pos
Point | draw_size
| position and size bounding-box for drawing
const AnimCursor * | animate_list
| in case of animated cursor, list of frames
const AnimCursor * | animate_cur
| in case of animated cursor, current frame
uint | animate_timeout
| in case of animated cursor, number of ticks to show the current cursor
bool | visible
| cursor is visible
bool | dirty
| the rect occupied by the mouse is dirty (redraw)
bool | in_window
| mouse inside this window, determines drawing logic
bool | vehchain
| vehicle chain is dragged

## Detailed Description

Collection of variables for cursor-display and -animation.

Definition at line 115 of file gfx_type.h.

## Member Function Documentation

## ◆ UpdateCursorPosition()

bool CursorVars::UpdateCursorPosition | ( | int | x,
|  | int | y
| ) |  |

Update cursor position on mouse movement.

Parameters

  x | New X position.
  y | New Y position.

Returns
  true, if the OS cursor position should be warped back to this->pos.

Definition at line 1749 of file gfx.cpp.

## ◆ UpdateCursorPositionRelative()

void CursorVars::UpdateCursorPositionRelative | ( | int | delta_x,
|  | int | delta_y
| ) |  |

Update cursor position based on a relative change.

Parameters

  delta_x | How much change in the X position.
  delta_y | How much change in the Y position.

Definition at line 1735 of file gfx.cpp.

References delta, and fix_at.

The documentation for this struct was generated from the following files:

- src/gfx_type.h
- src/gfx.cpp