Hello and good morning,
I am currently displaying a widget to my game viewport using SCanvas, and setting the size of a SColorBlock inside of it according the the values returned by the function GetScreenResolution() found in the user game settings class, I am setting the values utilizing this:
//FOR WIDTH
GEngine->GetGameUserSettings()->GetScreenResolution().X
//FOR HEIGHT
GEngine->GetGameUserSettings()->GetScreenResolution().Y
However, it seems its returning the wrong size, as if the widget were being scaled down, because, even though, through those functions i do get the real resolution, the widget size is still only about 60% of the screen.
Also, the alignment of the SCanvas is set to VAlign_Fill and HAlign_Fill, for width and height respectively.
I want to know what have i been doing wrong, or if is there a scale ratio for widgets that is doing that to my game.
*PS: I want to know if its a bug or how to fix it, I dont want to use a workaround or SOverlay, because i have other classes depending on this and i do not wish to reformulate them.
HERE IS A SNIPPET OF MY CODE:
//RETURNS 1280 FOR WIDTH AND 720 FOR HEIGHT
float width = GEngine->GetGameUserSettings()->GetScreenResolution().X;
float height = GEngine->GetGameUserSettings()->GetScreenResolution().Y;
ChildSlot
.VAlign(VAlign_Top)
.HAlign(HAlign_Left)
[
SNew(SCanvas)
+ SCanvas::Slot()
.VAlign(VAlign_Fill)
.HAlign(HAlign_Fill)
.Position(FVector2D(0, height - (height*0.07)))
.Size(FVector2D(width, height*0.07))
[
SNew(SColorBlock)
.Color(FColor(0, 0, 0, 100))
.Size(FVector2D(width, height*0.07))
]
];
AND HERE IS THE RESULT ON SCREEN: