constvf2dabilityTooltipSize{game->GetWrappedTextSizeProp(tooltipText,ABILITY_TOOLTIP_WIDTH)+vi2d{6,6}};//Add 3 pixel padding to the edges of the tooltip.
constvf2dabilityTooltipSize{game->GetWrappedTextSizeProp(std::format("{}\n\n{}",Ability::tooltipTitle,Ability::tooltipText),ABILITY_TOOLTIP_WIDTH)+vi2d{6,6}};//Add 3 pixel padding to the edges of the tooltip.
constvf2dabilityTitleSize{game->GetWrappedTextSizeProp(std::format("{}\n",Ability::tooltipTitle),ABILITY_TOOLTIP_WIDTH)};//Just the title, because we need to position the description below it.
geom2d::rect<float>tooltipRect{game->GetMousePos()-vf2d{abilityTooltipSize.x/2,abilityTooltipSize.y},abilityTooltipSize};//We will attempt to center it horizontally and bottom-align it to the cursor.
tooltipRect.pos.x=std::clamp(tooltipRect.pos.x,1.f,WINDOW_SIZE.x-tooltipRect.size.x-1);//It's possible the tooltip goes off-screen along the x-axis, clamp it to edges by a 1-pixel border.