Unreal SDK
Blockus provides an Unreal SDK to make it very easy to immediately add wallet support to any Unreal game.
Plugin setup & installation
- Request the Unreal SDK from your Blockus representative.
- Navigate to your project location and open the
Pluginsfolder, if that folder doesn’t exist, create a new one. - Paste the content of the unzipped files to the
Pluginsfolder. - Open the project with Unreal Engine.
- Activate both plugins
WebUIandJsonLibrary - Restart Unreal Engine and the plugins should be active for this project.
Create the widget blueprint
- Open the
Content Drawerin the project and click the+ Addbutton. - Inside
User Interfaceoption, selectWidget Blueprint - When Unreal Engine as for select the parent class, click on
User Widgetoption - Set the name you want for the Widget.
- Open the widget blueprint.
- On the blueprint editor, in the palette search box, look a
Canvas Paneland add to the blueprint. - Look for
Web Interfaceand place inside the canvas panel, also se the dimensions you want for the web browser. - Click the
Web Interfaceelement and change the value ofInitial URLto the the Blockus account management URL that was provided to you.
Open the browser widget inside the game
Now that the widget is created, you can attach the widget visualization to any event, a hit box collision, click event on button, keyboard event, etc. As an example here, we'll trigger the widget on the event BeginPlay of the level.
- Open the level blueprint and start a new flow with
BeginPlayevent. - Add to the flow the function called
Create Widgetand select theWebBrowserclass (the widget you previously created on the past tutorial) - Add the function
Add to viewportto the flow and connect the return value ofCreate Widgetfunction to the target value of the this function. - When you run the level, the widget will appear.
Updated about 1 month ago
