Hello every one… I want to replace my mouse cursor with a slate widget.
When I am using SCanvas, the location of the slate widget is appearing a lot off. Anyway how to do it?
IconLocation.Bind(this, &SCursorItemWidget::GetCursorLocation); ChildSlot SNew(SCanvas) .Visibility(EVisibility::HitTestInvisible) + SCanvas::Slot() .Position(IconLocation) .Size(FVector2D(64,64)) .HAlign(HAlign_Center) .VAlign(VAlign_Center) ] ];
I am getting the mouse position with something like this
But the mouse position is a lot off… Something similar to half of what it should be.
Image of what is wrong with .Position of canvas.
I am getting another problem. When I draw the mouse like this, any slate widget present below this is not responding to mouse clicks.
---------- Answers Till Now ----------
SAssignNew(CursorItemUI, SCursorItemWidget) .InvStorage((StoragePtr)); GEngine->GameViewport->AddViewportWidgetContent( SNew(SWeakWidget).PossiblyNullContent(CursorItemUI.ToSharedRef()) ); CursorItemUI.Get()->SetVisibility(EVisibility::HitTestInvisible);
This solves the 2nd problem the 2nd Widget is still above and causes no click problems.
According to my answer Hub post,
Something like this should work
But sadly is not working