Hi,
question is above. How can i get the x/y of any umg elements like images or whatever. Not
regarding of any parents or other childrens, but just x/y in viewport/screen.
Thanks in advance.
Hi,
question is above. How can i get the x/y of any umg elements like images or whatever. Not
regarding of any parents or other childrens, but just x/y in viewport/screen.
Thanks in advance.
I was wondering this same thing.
I see that there is function called SetPositionInViewport, which doesn’t seem to change positions of widgets. It makes me think GetPositionInViewport should exist but it seemingly does not
Try this
UCanvasPanelSlot* canvasSlot = UWidgetLayoutLibrary::SlotAsCanvasSlot(yourWidget);
canvasSlot->GetPosition();
Ok, sounds like the solution Great
But i want to make everthing with blueprints.
The reason for that is that it is not user-friendly when the user has to use an additional plugin (I do development within my own plugin :D)
Is there an existing BP solution. If not, i will add your solution as a function)
Meanwhile i have found a solution, but it worked for my case adventitiously. It is not a solution for everybody:
Solution:
Create a “Border” cause it supports MouseOnMove
Create and bind MouseOnMove to a function
Within the function you have a “MyGeomtry” output
Connect the “Absolute to Local” node and multiply it with the DPI Scale
To get the right DPI Scale Value, do this:
Create an external curve for DPI Scale
Cast to that curve and read out the “time value” depending on Y Value
By default the Y Value is the vertical resolution:
So create a “Get Viewport Size” and plug in the Y Value to the “read out” of
the curve
This solution only gives you the right Values when hovering the border with the mouse.