Asset Brush
Last updated
Last updated
The Asset Brush node allows you to use the "Slate Brush" asset created in the Reality Editor in Reality Setup. AssetBrush node has a single output and you only can set it to SlateBrush variable.
Open Reality Editor and create a Slate Brush from ADD NEW → User Interface → Slate Brush or access it via right click in empty area of content browser and choose it from component menu.
Open SlateBrush asset and configure it.
Save changes.
Open project settings from.
Open Exports tab which under Reality title.
Open Reality Editor and create a Slate Brush from ADD NEW → User Interface → Widget Blueprint or access it via right click in empty area of content browser and choose it from component menu.
Open up Widget Blueprint.
Click Graph Tab.
Open the Class Settings.
Change "Parent Class" as ZDRealityWidget from "Details Panel".
Open project settings from .
Open Exports tab which under Reality title.
Add "MyWidgetBlueprint" to Widget Class
For this tutorial we will add an image component and we will set Asset Brush node to the brush of image.
Add an Image component from Palette under Common Section.
Open Graph tab.
Add a slate brush variable. Click eye icon to make it public.
Your variables should be looking like the below image.
Add a custom event to the graph. And set the script as shown in the below image.
This event will set "MySlateVariable" to brush of "MyImage" variable.
Open Class Defaults of Widget Blueprint.
Add "SetMyLogo" event to "Reality Events" under Details.
Click PLAY button of editor.
Open Reality Setup Application.
Add ASSET BRUSH from Create → UMG
Set Brush of "AssetBrush" class.
Add UMGRENDERER from Create → UMG → UMG Renderer.
Set UMGRENDERER class.
Connect nodes as shown in the below image.
Click UMGRenderer Node and execute SetMyLogo function.