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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

[Closed] Tell me please, how I can detect MouseEnter on a custom form image in UMG?

Hello. Tell me please, how I can detect MouseEnter on a custom form image in UMG? (not rectangle, not circle). This image is like a part of some territory, part of a map and I need to highlight it on MouseEnter.

Product Version: Not Selected
Tags:
more ▼

asked May 26 '16 at 05:10 PM in Using UE4

avatar image

Answers.Archive STAFF
1.9k 204 312 684

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

The question has been closed May 26 '16 at 05:11 PM by AndrewHurley for the following reason:

The question is answered, right answer was accepted


3 answers: sort voted first

We do currently have a task (UETOOL-55) to implement hit test masks for UMG, but unfortunately I don't currently have an estimated date for when it would be implemented.

Your best option right now in blueprints would be to what Chris suggested. You can get an "On Mouse Move" event in blueprints which you can use to get the local mouse position.

alt text

Unfortunately there isn't a way to directly access pixel information from an image in blueprints, so you'd have to create either a custom asset type for the mask, or load the mask into a data table which you could check.

more ▼

answered May 26 '16 at 05:11 PM

avatar image

Answers.Archive STAFF
1.9k 204 312 684

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

Hi

There's no magic bullet for this. You just need to write your custom widget so that when it is hovered you translate the mouse position into widget space and use that to lookup into your image. You can choose how to mask it. Let me know if you need more help translating mouse positions.

Chris

more ▼

answered May 26 '16 at 05:11 PM

avatar image

Answers.Archive STAFF
1.9k 204 312 684

avatar image Answers.Archive STAFF May 26 '16 at 05:11 PM

Hello Chris. Can you show me an example how to do it?

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

I don't think we have an example. Are you looking to use Blueprint only or C++ too? My approach would probably be to write a new widget (derived from UBorder) in C++ but you might be able to do it in BP by creating a UserWidget that contains a Border plus a bunch of logic. Borders already provide an OnMouseMoveEvent that you can use. The event has a FPointerEvent argument that you should be able to translate into a local position that you can use as a UV to lookup into a mask texture or however you choose to do it. Then you can apply whatever visual effects you want based on the bit of your image you're hovering. You could tint the whole image, switch the image, etc.

more ▼

answered May 26 '16 at 05:11 PM

avatar image

Answers.Archive STAFF
1.9k 204 312 684

avatar image Answers.Archive STAFF May 26 '16 at 05:11 PM

Hello Chris. I would like to use Blueprint only. Tell me please, do you have plans to implement hit test by mask in UMG in the future releases of UE4?

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

Follow this question

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

Answers to this question