Hello, I am quite stuck on what I’d expect to be quite a simple issue.
When I spawn a buff object from class (in this case “Debuff Burn”) It takes an Image object that it then uses to display the image.
However my texture files are “Texture2d”
So how can I get the tab in my first picture filled in with the textures from the second picture?
Can I perhaps convert the textures to images in some way? Something like this?
I am also interested in knowing the vice versa because I could just change the debuff to take a texture, fixing the initial issue, but that means having to get the texture2d from an image object down the line, which I couldnt figure out either…
Tried to fix it like this: Letting my class take a texture (instead of an image object) and then constructing an image object and setting its brush before then sending it to my “add buff to slot” function
This doesn’t seem to work either as it’s still just using a white image (which im assuming is just what it defaults to)
Left (white box): The icon that becomes visible from running with construct image (or if i don’t select any texture at all)
Right (Arrows): The default icons when they are set correctly
Is there problems in my add buff to slot function maybe?
Yes, (at least in the Widget Designer) white is the default when no Brush is set. So I also assume that the texture size gets properly set by Set Brush from Texture.
I have no ready solution, but for debugging,
maybe you could try to check if the input image from Add Buff to Slot is loaded (with the Is Loaded node)?
And/or try to Async Load Asset the image before sending it to the Make SlateBrush?
All was valid, but it does make sense, since it just creates the image object with the white brush, it seems like the passed image does not have the updated brush from “set brush from texture”
I had tried this earlier without getting the brush from buff icon and then breaking that. But both objects seem to be the same to me, maybe someone can explain the difference in these pics =p
That’s what I meant by vice versa i changed that to take a texture ref, but that lead to other code down the line needing to go from image->texture as seen on latest pics.
The first time i casted i just did it straight and it gave an error, but after getting brush, breaking that and then casting it worked fine.