Event Listeners

Introduction

Provided below are functions that activate when data is sent to the App from the widget.

Name
Description

onMessage

Function that activates when messages sent from widget are received on the App

πŸ“š API Explanation and Example

onMessage

circle-info

widget.onMessage.Add(function(player, data: any){});

Callback function that activates when a message is sent from the widget to the App.

Parameters

Name
Type
Description

player

Player

The player who owns the widget

data

Object

The message sent from the widget to the App

Example

Create a function to close the widget screen when x is pressed.

file-archive
15KB

sample.html: Button and script section

Last updated

Was this helpful?