Get Image from Widget Blueprint in C++
I'm new to Unreal Engine and currently practicing to code with it in C++.
I made a Widget with an image in its canvas.
How can I access this image from my C++ code ?
I made a new UserWidget class and reparented it.
My current attempt was something like that:
After this step I wanted to call a Tick void in my Widget class and fade my image in and out like I did in blueprint before. My code is currently like that:
I suggest you add a BlueprintImplementableEvent to UMyUserWidget like so:
Then, you go into your Widget-Blueprint and override the function. Inside the function's implementation you return the image.
Now, within your C++ code you can simply call GetMyImage() and you will receive the pointer to the UImage, as returned from the Blueprint implementation.
answered Aug 20 '15 at 11:23 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here