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"

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
Tags:
mybp.png (59.1 kB)
more ▼

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

avatar image

Gavin.Kistner
94 3 9 11

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

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

Everynone
6.5k 45 19 37

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

Thank you, Everynone.

(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