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
Plugins
folder, if that folder doesn’t exist, create a new one. - Paste the content of the unzipped files to the
Plugins
folder. - Open the project with Unreal Engine.
- Activate both plugins
WebUI
andJsonLibrary
- Restart Unreal Engine and the plugins should be active for this project.
Create the widget blueprint
- Open the
Content Drawer
in the project and click the+ Add
button. - Inside
User Interface
option, selectWidget Blueprint
- When Unreal Engine as for select the parent class, click on
User Widget
option - Set the name you want for the Widget.
- Open the widget blueprint.
- On the blueprint editor, in the palette search box, look a
Canvas Panel
and add to the blueprint. - Look for
Web Interface
and place inside the canvas panel, also se the dimensions you want for the web browser. - Click the
Web Interface
element and change the value ofInitial URL
to 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
BeginPlay
event. - Add to the flow the function called
Create Widget
and select theWebBrowser
class (the widget you previously created on the past tutorial) - Add the function
Add to viewport
to the flow and connect the return value ofCreate Widget
function to the target value of the this function. - When you run the level, the widget will appear.
Updated about 1 year ago