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"

Communicating from Blueprint to UI Widget

I have a working blueprint that swaps materials on the floor whenever I left-click and I want to connect this to the widget where a border elelent will appear around the corresponding thumbnail. Here is a video of what it looks like:

https://youtu.be/l8cdfdxK_rE

As you can see in the video, I would like a white border to highlight the corresponding thumbnail. I created an event with an Integer as an input variable and a different number is assigned to each material. I just don't know how to get this firing off in my widget blueprint. I am trying to bind the "Is Enabled" option but I'm lost as to how to activate it from the other blueprint.

My material swapping blueprint looks like this:

alt text

And my widget looks like this:

alt text

Product Version: UE 4.12
Tags:
more ▼

asked Dec 27 '16 at 07:57 AM in Blueprint Scripting

avatar image

Defiant Child
3 2 3

avatar image Pr0t0Ss12 Dec 27 '16 at 10:24 AM

In case like this i use system like "widget inside widget", more detail you can know in InventoryUIwithUMG in Lern tab. Or why you are not using buttons with image inside?

avatar image Defiant Child Dec 27 '16 at 10:15 PM

Im not using buttons because I dont want to use the mouse cursor as the mouse cursor is used only to steer the player. I want the left click or a key to send the event to swap materials.

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

1 answer: sort voted first

Hi!

It looks like the cast nodes isn't connected in the material swapping blueprint. If you want to make them pure, you can right click on them and convert them to pure functions.

Also, you need to select which widget you want to get under "Widget Class" on the Get all widgets of class node.

more ▼

answered Dec 27 '16 at 01:17 PM

avatar image

Fryderider
125 6 11 13

avatar image Defiant Child Dec 27 '16 at 10:20 PM

Thank you for your response. I thik I fixed the cast node connections. I right clicked on the cast nodes and selected "pure cast". I also connected the "Get All Widget Classes" nodes to the "Color Changed Events". Now my question is how to set up my widget blueprint to receive the events.

avatar image Fryderider Dec 28 '16 at 01:50 AM

I hope I understand you correctly, and I don't know if this is the best solution, but it should work. It looks like you already have a custom event in the widget itself. From that event, promote a variable from the int. alt text

Then, on one of your borders create a binding under visibility. alt text

In that function you could do something like this.alt text

Then of course do the same with the other borders, but visible with another int.

1.png (36.7 kB)
2.png (16.2 kB)
3.png (75.9 kB)
avatar image Defiant Child Dec 28 '16 at 06:43 AM

This does the job! Thanks a lot!

(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