![]() |
Cockatrice 2026-03-05-Development-2.11.0-beta.54
A virtual tabletop for multiplayer card games
|
Functions | |
| constexpr qreal | childDragZValue (qreal hotSpotX, qreal hotSpotY) |
| Compute Z-value for child drag items based on hotspot position. | |
| constexpr qreal | tableCardZValue (qreal x, qreal y) |
| Compute Z-value for cards on the table zone based on position. | |
Variables | |
| constexpr qreal | OVERLAY_BASE = ZValueLayerManager::OVERLAY_BASE |
| constexpr qreal | HOVERED_CARD = ZValueLayerManager::overlayZValue(1.0) |
| constexpr qreal | ARROWS = ZValueLayerManager::overlayZValue(3.0) |
| constexpr qreal | ZONE_VIEW_WIDGET = ZValueLayerManager::overlayZValue(4.0) |
| constexpr qreal | DRAG_ITEM = ZValueLayerManager::overlayZValue(5.0) |
| constexpr qreal | DRAG_ITEM_CHILD = ZValueLayerManager::overlayZValue(6.0) |
| constexpr qreal | TOP_UI = ZValueLayerManager::overlayZValue(7.0) |
| constexpr qreal | CARD_BASE = 1.0 |
| constexpr qreal | CARD_MAX = ZValueLayerManager::CARD_Z_VALUE_MAX |
|
nodiscardconstexpr |
Compute Z-value for child drag items based on hotspot position.
When dragging multiple cards together, each child card needs a unique Z-value to prevent Z-fighting (flickering/flashing). The Z-values are derived from their position when grabbed to conserve original stacking. The formula encodes 2D coordinates into a single value where X has higher weight, ensuring deterministic visual stacking.
| hotSpotX | The X coordinate of the grab position |
| hotSpotY | The Y coordinate of the grab position |
|
nodiscardconstexpr |
Compute Z-value for cards on the table zone based on position.
Cards lower on the table (higher Y) render above cards higher up, and cards to the right (higher X) render above cards to the left. This creates natural visual stacking for overlapping cards.
| x | The X coordinate of the card position |
| y | The Y coordinate of the card position |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |