Hi, I am making a game with the idea of multiple viewpoints at once. We are accomplishing this by drawing textures on the HUD. We are able to create 2 at runtime using this code.
AMyHUD::AMyHUD(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
// Set the crosshair texture
static ConstructorHelpers::FObjectFinder<UTexture> CrosshiarTexObj(TEXT("/Game/Material/T_Map1"));
MiniTexture = CrosshiarTexObj.Object;
static ConstructorHelpers::FObjectFinder<UTexture> CrosshiarTexObj2(TEXT("/Game/Material/T_Map3"));
MiniTexture2 = CrosshiarTexObj2.Object;
}
void AMyHUD::DrawHUD()
{
Super::DrawHUD();
float ScreenX = 0;
float ScreenY = 0;
float ScreenW = 0;
float ScreenH = 0;
ScreenW = 300;
ScreenH = 300;
drawTexture(MiniTexture, ScreenX, ScreenY, ScreenW, ScreenH);
ScreenX = 600;
drawTexture(MiniTexture2, ScreenX, ScreenY, ScreenW, ScreenH);
}
And in the player controller I want to add a camera to the HUD with
InputComponent->BindAction("EKey", IE_Released, this, /*Function to add camera here*/);
Any ideas on how to do this?
We are not committed to using the HUD for our screens, it just happened to be the first thing that worked.