Loading MatchX game as part of your website
MatchX game can be shown as a separate page on your main website
You need to create an empty IFRAME element and set it specific to your design height and width styles.
As soon as the player is authorized you can make a JavaScript call
The first argument is the ID of the MatchX game template (you can have multiple).
The second argument is a set of parameters:
iframe - id of the IFRAME element, where the game will be shown.
zoom - optionally gives a possibility to zoom in/out the UI of the game
height - can be set to 'auto' or to fixed height in pixels, e.g. '500px'. It's recommended to set the value to 'auto' for desktop users and to the fixed height on mobile devices. This approach will provide the best UX.
Example of the HTML/JavaScript code
Please note that if the 'width' of the div is 576px or less, the rendered UI will be adjusted for mobile devices.
Please note that at the time of the call to smartico.miniGame, the Smartico script should be already loaded. Otherwise, you will get an exception that _smartico is undefined.
If you don't have good control from the JavaScript when _smartico script is loaded, you can use the code below to trigger the game without exception.
You can see more examples of embedding MatchX and other gamification components on this demo page:
Last updated