TGUI  0.9.5
Loading...
Searching...
No Matches

Class that allows the cursor to be changed. More...

#include <TGUI/Cursor.hpp>

Public Types

enum class  Type {
  Arrow , Text , Hand , SizeLeft ,
  SizeRight , SizeTop , SizeBottom , SizeTopLeft ,
  SizeBottomRight , SizeBottomLeft , SizeTopRight , Crosshair ,
  Help , NotAllowed
}
 List of available cursors. More...
 

Static Public Member Functions

static void setStyle (Type type, const std::uint8_t *pixels, Vector2u size, Vector2u hotspot)
 Changes how a specific cursor should look like.
 
static void resetStyle (Type type)
 Changes the look of the cursor back to the default system cursors.
 

Detailed Description

Class that allows the cursor to be changed.

Member Enumeration Documentation

◆ Type

enum class tgui::Cursor::Type
strong

List of available cursors.

Enumerator
Arrow 

Arrow cursor (default)

Text 

I-beam, cursor when hovering over a text field.

Hand 

Pointing hand cursor.

SizeLeft 

Left arrow on Linux, horizontal double arrow cursor on Windows and macOS.

SizeRight 

Right arrow on Linux, horizontal double arrow cursor on Windows and macOS.

SizeTop 

Up arrow on Linux, vertical double arrow cursor on Windows and macOS.

SizeBottom 

Down arrow on Linux, vertical double arrow cursor on Windows and macOS.

SizeTopLeft 

Top-left arrow on Linux, double arrow cursor going from top-left to bottom-right on Windows and macOS.

SizeBottomRight 

Bottom-right arrow on Linux, double arrow cursor going from top-left to bottom-right on Windows and.

SizeBottomLeft 

Bottom-left arrow on Linux, double arrow cursor going from bottom-left to top-right on Windows and macOS.

SizeTopRight 

Top-right arrow on Linux, double arrow cursor going from bottom-left to top-right on Windows and macOS.

Crosshair 

Crosshair cursor.

Help 

Help cursor.

NotAllowed 

Action not allowed cursor.

Member Function Documentation

◆ resetStyle()

static void tgui::Cursor::resetStyle ( Type  type)
static

Changes the look of the cursor back to the default system cursors.

Parameters
typeWhich cursor's look should be reset?

◆ setStyle()

static void tgui::Cursor::setStyle ( Type  type,
const std::uint8_t *  pixels,
Vector2u  size,
Vector2u  hotspot 
)
static

Changes how a specific cursor should look like.

Parameters
typeWhich cursor's look has to be changed?
pixelsPointer to an array with 4*size.x*size.y elements, representing the pixels in 32-bit RGBA format
sizeSize of the cursor
hotspotPixel coordinate within the cursor image which will be located exactly at the mouse pointer position

By default the system cursors are used, this function allows replacing them with bitmaps. The effects of this function can be undone by calling resetCursorLook.


The documentation for this class was generated from the following file: