Hello, Can anyone help with problem: I’m trying to draw a line(spline) in widget during drag operation. But as I understand, while drag and drop operation is active it takes player controller and calling Get Mouse Position Scaled by DPI function returns 0,0. As I tested there is another function Get Mouse Position on Viewport, but I assume it is bad practice to call it in game. Is there any possibility to draw line from drag start to mouse cursor?
Additionally, i’m interested how to draw curved line, filled with some images(i.e. arrows) in widget. I think I should interpolate curve line points and draw widgets from this points. Is there somewhat more clever approach to this problem?
look into the hud class, i know it has drawrect probably has draw line too
Yes, there is whole pack of methods such as draw line and draw spline and so on. But my question not how to draw, but how to determine end point as mouse position during drag operation.
there is nothing wrong with get mouse position in viewport if thats what you need, or get hit result under cursor if you need the world position or convert between the two
Thanks a lot. I’m trying to make card hand system in widgets. Still learning and trying to implement “Slay the spire” like arrow from card to target when dragging it. I`m just afraid that viewport mouse position is wrong because coordinates goes outside viewport instead of 0 to max viewport size an in mouse coordinates from controller.
im not sure how coordinates would go outside viewport but can just clamp them if thats the case
Again thanks for help. Clamping to GetPlayerScreenWigdetGeometry Local Size made the thing if someone will accure same problem as me.
But I have another problem: determine how to draw curved line contains images(i.e. arrows) or just custom line for example tappering to the end in widget. I can use plugin from marketplace, but I just can’t buy it for now.