-
Notifications
You must be signed in to change notification settings - Fork 57
JavaScript API
All images can be opened with the orinal size by RMB -> "Open image in new tab"
Unlike other web UI solutions for UE4 VaQuoleUI plugin uses raw script code commands to control the UI. It is most powerfull and flexible approach that gives full control of web application.
I'm pretty sure that it's better to write your own macroses to build the script with parameters you want than meet a limitations of "supplied interface".
You can get the extra power using the VaRest plugin with blueprintable Json objects.
All values received with events from web application are serialized to FString
. You can send them from web UI as serialized Json string, and then process it with as a Json in blueprints.
It will be the best option to handle large amounts of data.
Using EvaluateJavaScript
node you can send JavaScript code to the web application and evaluate it. Because of asynchronous nature of VaQuoleUI plugin the return value of evaluated script can be received with the FScriptEvalResult
event only.
The event has two parameters:
-
FString
Eval Uuid -
FString
Eval Result
Being queued script command generates the Uuid that can be used to match the evaluation event with previously sent command. Despite on original type return value will be serialized to FString
. See the example with notes below.
You can send custom events from the web application too. To send the event you should call scriptEvent("Command", "Message")
function of VaQuoleWebView
object with JavaScript: VaQuoleWebView.scriptEvent("ConsoleCommand", "showhud");
On the game side the event FScriptEvent
will be broadcasted with two parameters:
-
FString
Event Name -
FString
Event Command
Check the ConsoleCommand event example below.
Check the provided application \VaQuoleUI\UIResources\example.html
with both ways communication examples.