Ejemplo n.º 1
0
void ASHUD::DrawCenterDot()
{
	float CenterX = Canvas->ClipX / 2;
	float CenterY = Canvas->ClipY / 2;

	float CenterDotScale = 0.07f;

	ASPlayerController* PCOwner = Cast<ASPlayerController>(PlayerOwner);
	if (PCOwner)
	{
		ASCharacter* Pawn = Cast<ASCharacter>(PCOwner->GetPawn());
		if (Pawn && Pawn->IsAlive())
		{
			// Boost size when hovering over a switchable object.
			ASUsableActor* usable = Pawn->GetUsableInView();
			if (usable)
				CenterDotScale *= 1.5f;

			Canvas->SetDrawColor(255, 255, 255, 255);
			Canvas->DrawIcon(CenterDotIcon,
				CenterX - CenterDotIcon.UL*CenterDotScale / 2.0f,
				CenterY - CenterDotIcon.VL*CenterDotScale / 2.0f, CenterDotScale);
		}
	}
}
Ejemplo n.º 2
0
void ASHUD::DrawCenterDot()
{
	float lCenterX = Canvas->ClipX * 0.5f;
	float lCenterY = Canvas->ClipY * 0.5f;
	float lCenterDotScale = 0.07f;

	ASPlayerController* lOwner = Cast<ASPlayerController>(PlayerOwner);
	if (lOwner)
	{
		ASCharacter* lPawn = Cast<ASCharacter>(lOwner->GetPawn());
		if (lPawn && lPawn->IsAlive())
		{
			ASUsableActor* lUsable = lPawn->GetUsableInView();
			if (lUsable)
				lCenterDotScale *= 1.5f;

			Canvas->SetDrawColor(255, 255, 255, 255);
			Canvas->DrawIcon(CenterDotIcon,
							 lCenterX - CenterDotIcon.UL * lCenterDotScale * 0.5f,
							 lCenterY - CenterDotIcon.VL * lCenterDotScale * 0.5f,
							 lCenterDotScale);
		}
	}
}