Is there a way to prevent onDrop from going off screen?
I have tried doing it with C++ (for some reason it does not work), I have done it but I have a sudden movement when I change the “XY” from local to global, I have tried with Blueprint, I have not had any luck either. I have tried “Clamp”. I haven’t had any luck.
Is there a formula that tells you that it prevents dropping off the screen?
I think you’d want to handle any kind of clamping elsewhere, OnDrop will likely be called too late for what you’re trying to achieve.
Have you tried setting the input mode and temporarily locking the cursor to the viewport? eg. start dragging, lock cursor, drop widget (or cancel dragging), unlock cursor.
There’s also the global setting for mouse lock mode under Project Settings > Engine > Input.
I don’t understand anything you told me. I’m going for points.
OnDrop will likely be called too late for what you’re trying to achieve.
It runs where and how I want (except for a couple of cases where the context varies and here I don’t know how to fix it).
Have you tried setting the input mode and temporarily locking the cursor to the viewport?
What’s the point of blocking the mouse temporarily? I don’t understand this concept at all.
I don’t want to block anything, I want that when onDrop is done if the box (size) is outside the window (by 1mm) it won’t be outside the screen.
Even if I temporarily blocked the mouse (which, by the way, is the worst idea I’ve heard in a long time) the mouse would be blocked and the box cut in two from the screen. That is not even an approach to make. That idea is not even going to occur to me.
Your solution would just hide and lock the mouse leaving this:
I’m not looking for this, I’m looking for:
Drag →
Drop →
I’m looking for the same function that the ToolTip does (a big, long ToolTip) that when moved never leaves the screen box. Whoever did that feat, for me is already God. Surely a mathematician.