Download

Slate Style - FSlateSound - How to create it to set it in FButtonStyle PressedSound property

Hi,

I can’t find any example on how to create properly a FSlateSound to set in PressedSound of a button.

All the samples that I found are:
FSlateSound::FromName_DEPRECATED(FName(“SoundCue’/Game/UI/Sounds/…”));

But as the name of the function said, it’s Deprecated.
I bet I have to call “SetResourceObject” with a USoundBase but i’m not confident this is it and I don’t want to load all my UI Sound when creating my style.
it’s not required until it’s used (what the old method do).

More usually in a Deprecated function, Epic said what should be used instead but here no hint have been provided. Even Slate Base code is using this deprecated function.

Thanks,