Texture brush node which is using with UMG components converts your texture input to slate brush variable. This means you can set your slate brush variable or change in run-time on Reality API.
- Use ADD NEW button > User Interface then select Widget Blueprint.
- Select Graph tab, open class settings and set "Parent Class" as "ZDRealityWidget" which under Details Tab.
- Select Designer tab, add an image from Common section under the Palette and check "Is Variable" selection.
- Open Graph tab. Add new variable from Variable section. Select it as "SlateBrush" variable.
- Make it public. Click eye icon.
- Create code block with blueprint. (Basically, we will set "MySlateBrush" variable to "myImage" with SET BRUSH node.)
- Export your widget Blueprint from Edit > Project Settings > Exports. Add new export value under UMG > Widget Classes.
- Everything is ready for Setup API. Click PLAY button. Open Reality Setup.
- Add an UMGRENDERER node
- Select specific UMG class on Widget property from properties of UMGRENDERER node
- Add a TEXTUREBRUSH from CREATE → UMG
- Add a "CheckerGenerator" for basic input from Create > Generator > Checker Generator.
- Connect nodes as shown in the below image.
- Let's see the result.