x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

2D widget jumps erratically when moving

Hey Team,

I am attempting to implement a generic moving widget with a single content slot but have run into an issue getting the mouse position relative to the widget being moved.

Youtube video example of bug: https://youtu.be/t3xc6fFbWAQ

It appears as though the result from Absolute to Local in MouseMove is acting erratically depending on the mouse position, which I guess is caused by a flaw in my logic. The offset is staying constant and the screen position is working correctly.

Am I setting the widget's position incorrectly, or am I getting the relative position incorrectly?

MouseDown alt text MouseMove alt text Mouse Up alt text

Cheers, Mugen

Product Version: UE 4.9
Tags:
mouseup.jpg (37.8 kB)
mousedown.jpg (58.2 kB)
mousemove.jpg (123.2 kB)
more ▼

asked Sep 22 '15 at 11:28 PM in Blueprint Scripting

avatar image

MugenCity
182 12 18 104

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Turns out this is not the best way to do moving widgets.

Instead use drag-drop. Implement OnMouseDown on the draggable widget (say a generic draggable border). Add a function call to "Detect Drag If Pressed" and return the result. Also override OnDragDetected, where you create a drag drop operation and add your draggable widget as the payload and default drag visual. Return this operation.

In another external widget, such as a "UI" widget that contains your draggable widgets, override OnDrop. Break open the operation in OnDrop and cast the operation's payload to your draggable widget. Set the newly cast widget's parent to self. Also you can set the position of the new widget to the mouse position, or whatever you want.

And there you have draggable widgets.

more ▼

answered Oct 19 '15 at 02:33 AM

avatar image

MugenCity
182 12 18 104

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question