I’m trying to develop a slate widget that can switch the display image being read from file at the click of a button. I’ve set up an SImage on a menu that takes a FSlateImageBrush as shown here:
and the header file:
The SMenu object is being applied to a HUD class during runtime, but the SImage is only showing up as a white box, not as the image in the path specified. Here is what it looks like when I run it in the editor:
I had this problem because my path just wasn’t finding/loading my asset even though it was correct. You may find some kind of “Failed to load…” error in your log. I ended up just making a variable for it in my game instance (if you have yours in c++, you can make a BP class that inherits from it and set the reference there, make sure the variable is marked as “EditAnywhere”) and accessing it from there. This is generally the recommended way to load assets since the editor will always maintain the reference even if you move the asset around or package your game, so you’ll never have to worry about a bad path.