void UImage::SetBrushFromAsset(USlateBrushAsset* Asset) { Brush = Asset ? Asset->Brush : FSlateBrush(); if ( MyImage.IsValid() ) { MyImage->SetImage(&Brush); } }
void UBorder::SetBrushFromAsset(USlateBrushAsset* Asset) { Background = Asset ? Asset->Brush : FSlateBrush(); if ( MyBorder.IsValid() ) { MyBorder->SetBorderImage(&Background); } }
FSlateBrush UJavascriptEditorStyle::GetBrush(const FName& StyleName) { auto Brush = FEditorStyle::Get().GetBrush(StyleName); return Brush ? Fixup(*Brush) : FSlateBrush(); }
UObject* USlateBrushAssetFactory::FactoryCreateNew(UClass* Class,UObject* InParent,FName Name,EObjectFlags Flags,UObject* Context,FFeedbackContext* Warn) { USlateBrushAsset* NewSlateBrushAsset = NewObject<USlateBrushAsset>(InParent, Name, Flags); NewSlateBrushAsset->Brush = InitialTexture != NULL ? FSlateDynamicImageBrush( InitialTexture, FVector2D( InitialTexture->GetImportedSize() ), NAME_None ) : FSlateBrush(); return NewSlateBrushAsset; }