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"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

Change tint of image in widget component, using BP

I have a Blueprint Class (`DetectionActor`). It has a Widget component attached to the root; the Widget component has the Widget Class set to DetectionMat, which is a Widget Blueprint I have created.

DetectionMat has a single image widget attached to the root (named Patch9). I want to change the color of Patch9.

Image showing both DetectionActor and DetectionMat

Manually changing any of the following properties in the editor does what I want:

  • DetectionMat/ColorAndOpacity

  • DetectionMat/ForegroundColor

  • DetectionMat/Patch9/Tint

  • DetectionMat/Patch9/ColorAndOpacity

    How can I change these properties at runtime, from DetectionActor's BP?

Here's what I've tried in my blueprint (all failed):

  1. Call Set Tint Color and Opacity, passing in Widget component reference. Does nothing.

  2. Cast the Widget component to a DetectionMat (the editor says this will always fail).

  3. Get Children of Widget, in an attempt to get a reference to Patch9 (this gives me Scene Components, which can't be cast to UserWidget)

Product Version: Not Selected
mybp.png (59.1 kB)
more ▼

asked Apr 13 '18 at 07:46 PM in Blueprint Scripting

avatar image

199 8 14 25

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

You can access the embedded widget like so:

alt text

capture.png (136.8 kB)
more ▼

answered Apr 13 '18 at 10:47 PM

avatar image

13.7k 74 25 57

avatar image Gavin.Kistner Apr 16 '18 at 04:40 PM

Thank you, Everynone.

(comments are locked)
10|2000 characters needed characters left
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