How to use C + + to set the picture of the button

How to use C + + to set the picture of the button

I guess it’s SetStyle(), and you feed to it an FButtonStyle struct, which is a massive struct with a lot of nested sub-structs, so you’ll spend some time finding exactly which variables you have to set. But it’s all there.

我也遇到了相同的问题,我的需求是使用 c++ 修改鼠标悬停按钮上的图片效果。我查到FButtonStyle结构了,但我不知道如何使用它,因为它的案例我没找到。

我通过查找资料找到在c++如何操作了,使用 FSlateBrush SlateBrush;
SlateBrush.SetResourceObject(ButtonBackground); //ButtonBackground为图片资源就可以设置图片了。