ezEngine Release 26.9
Loading...
Searching...
No Matches
ezMouseCursorDesc Struct Reference

#include <Declarations.h>

Public Member Functions

bool operator== (const ezMouseCursorDesc &rhs) const
 
bool operator!= (const ezMouseCursorDesc &rhs) const
 

Public Attributes

ezString m_sCursor
 
float m_fSize = 1.0f
 
ezVec2 m_vHotspot = ezVec2(0.0f)
 
ezVec2 m_vUvTopLeft = ezVec2(0.0f)
 The sub-rectangle of the image to display. Use this for texture atlases and animated cursors.
 
ezVec2 m_vUvBottomRight = ezVec2(1.0f)
 
ezAngle m_Rotation
 Rotation of the cursor image around its hotspot. Positive angles rotate clockwise on screen.
 
ezColor m_Color = ezColor::White
 The cursor image is multiplied with this color. Useful for state changes without extra artwork.
 

Detailed Description

Abstract description of a custom ('software') mouse cursor.

The ezInputManager only stores this data, it never interprets m_sCursor and it does not render anything. A higher level system (ezMouseCursorRenderer in the GameEngine library) reads this, resolves the identifier to an actual resource and draws the cursor on top of everything else.

See also
ezInputManager::SetMouseCursor()

Member Data Documentation

◆ m_fSize

float ezMouseCursorDesc::m_fSize = 1.0f

Scales the size of the cursor image.

The base size is ezInputManager::GetHardwareCursorSize(), which makes the custom cursor match the size of the OS cursor on any monitor, resolution and DPI scaling. Use this only to deliberately deviate from the size that the user configured.

◆ m_sCursor

ezString ezMouseCursorDesc::m_sCursor

Identifies which cursor to display. An empty string means that no custom cursor is used.

This is either the GUID of a material or texture asset ("{ ... }"), or a path to one. Whether it is a material or a texture is figured out by the system that renders the cursor (ezMouseCursorRenderer determines it from the file extension that the identifier resolves to).

◆ m_vHotspot

ezVec2 ezMouseCursorDesc::m_vHotspot = ezVec2(0.0f)

The point of the image that shall sit exactly on the mouse position, in normalized coordinates. (0,0) is the top-left corner of the image, (0.5,0.5) its center.

This is also the pivot around which m_Rotation is applied.


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