I just found that virtual joystick do not use the same scaling as UMG widget.
static FORCEINLINE float GetScaleFactor(const FGeometry& Geometry)
it is hardcoded a **const float DesiredWidth = 1024.0f; **to calculate DPI.
It is hard to place UMG widget properly with Joytick as they don’t follow the same DPI rules.
I’m on a mobile game so the resolution change a lot between devices and I need to be able to control this.
I submit a “bug” request but until then can someone help me on how to fix this?
I already try to do in the GetScaleFactor:
const FVector2D viewportSize = FVector2D(GEngine->GameViewport->Viewport->GetSizeXY()); const float viewportScale = GetDefault<UUserInterfaceSettings>(UUserInterfaceSettings::StaticClass())->GetDPIScaleBasedOnSize(FIntPoint(viewportSize.X, viewportSize.Y));
Sadly, the result are not right. I must miss something in the paint/geometry allocation process in slate but I can get where.
@Nick_Darnell I know you build a lot of the UMG Widgets, could you please give me some hint on how to solve this?