UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FSlateSound Struct Reference

#include <SlateSound.h>

Public Member Functions

SLATECORE_API FSlateSound ()
 
SLATECORE_API FSlateSound (const FSlateSound &)
 
SLATECORE_API FSlateSoundoperator= (const FSlateSound &)
 
SLATECORE_API UObjectGetResourceObject () const
 
void SetResourceObject (class UObject *InResourceObject)
 
SLATECORE_API void StripLegacyData_DEPRECATED ()
 
SLATECORE_API bool SerializeFromMismatchedTag (struct FPropertyTag const &Tag, FStructuredArchive::FSlot Slot)
 

Static Public Member Functions

static SLATECORE_API FSlateSound FromName_DEPRECATED (const FName &SoundName)
 

Protected Attributes

TObjectPtr< UObjectResourceObject
 
FName LegacyResourceName_DEPRECATED
 
TWeakObjectPtr< UObjectLegacyResourceObject_DEPRECATED
 

Detailed Description

An intermediary to make UBaseSound available for Slate to play sounds

Constructor & Destructor Documentation

◆ FSlateSound() [1/2]

FSlateSound::FSlateSound ( )

Default constructor.

◆ FSlateSound() [2/2]

FSlateSound::FSlateSound ( const FSlateSound )
default

Default copy constructor.

Member Function Documentation

◆ FromName_DEPRECATED()

FSlateSound FSlateSound::FromName_DEPRECATED ( const FName SoundName)
static

Construct a FSlateSound from a FName

Note
This functionality is deprecated and should only be used for upgrading old data
Parameters
SoundNameThe name of the sound to load, eg) SoundCue'/Game/QA_Assets/Sound/TEST_Music_Ambient.TEST_Music_Ambient'
Returns
An FSlateSound object with a ResourceObject pointer that's either set the given sound, or points to null if the sound could not be found

◆ GetResourceObject()

UObject * FSlateSound::GetResourceObject ( ) const

Get the resource object associated with this sound

Note
Ensure that you only access the resource as a USoundBase
Returns
The resource object, or null if this sound resource is empty

◆ operator=()

FSlateSound & FSlateSound::operator= ( const FSlateSound )
default

Default copy-assignment operator.

◆ SerializeFromMismatchedTag()

bool FSlateSound::SerializeFromMismatchedTag ( struct FPropertyTag const &  Tag,
FStructuredArchive::FSlot  Slot 
)

Used to upgrade a FName property to a FSlateSound property

◆ SetResourceObject()

void FSlateSound::SetResourceObject ( class UObject InResourceObject)
inline

Sets the sound that is supposed to be played.

◆ StripLegacyData_DEPRECATED()

void FSlateSound::StripLegacyData_DEPRECATED ( )

Used when updating the ResourceObject within an FSlateSound from the editor to clear out any legacy data that may be set.

Member Data Documentation

◆ LegacyResourceName_DEPRECATED

FName FSlateSound::LegacyResourceName_DEPRECATED
protected

The legacy resource name; only used by sounds that have been set-up in code, or otherwise upgraded from old FName properties, set to NAME_None in non-legacy instances

◆ LegacyResourceObject_DEPRECATED

TWeakObjectPtr<UObject> FSlateSound::LegacyResourceObject_DEPRECATED
mutableprotected

A weak pointer the the resource loaded from the legacy resource name; may be null if the resource needs (re)loading

◆ ResourceObject

TObjectPtr<UObject> FSlateSound::ResourceObject
protected

Pointer to the USoundBase. Holding onto it as a UObject because USoundBase is not available in Slate core. Edited via FSlateSoundStructCustomization to ensure you can only set USoundBase assets on it.


The documentation for this struct was generated from the following files: