I created a userwidget, and into, I used an image. But the content of the image must be different depending on context.
So I want to modify the asset dynamically, depending of the value of a string (pathname of the asset in fact).
How in blueprint, I can modify this asset from my image?
Well there is no need to use the pathname for the asset. You can just reference to assets in UMG. You could use the [property binding feature of UMG][1] to change the image dynamically. [Another example][2].
So you can just go into your image and do the same for it here.
I am aware about binding, and I use it for example for life bar.
But on image, the binding is on the whole brush, and one of the pin is the asset.
The information of which image I have to load come from a string value.
I need to update the asset, even if it a binding, from a string value. How can I “transform” my string value to an asset.
I didn’t see an asset search from path name for example, or so on… just the combobox on the asset choice.
So I wonder if it is possible or not… for the moment I have just do a test on my string value, with a select, to define which asset to choose between two. But If I have 100 differents assets, I think It will no more maintenable to have to make switch between 100 possibilities
In fact, I have a json describing a quest, and all information to display the quest is stored into.
So I got only string value, and from that, I have to display the right face of the npc for example.
With the context of my question, it is easier, I think to understand.
I think I will use FStringAssetReference, to find the texture from the filepathname, and pass the result to my blueprint.
It will be in C++, but it is not a matter