12. Fullscreen

Sometimes it's preferred to enter fullscreen mode to provide players a better experience. Since the game executes inside an iframe, by using standard web APIs, the iframe element will be promoted to the very front causing many functionalities such as floating ball, announcement, advertisement, etc. to be covered by the fullscreen element.

The SDK provides replacements for the standard fullscreen web APIs.

※ This function is available since SDK version 3.1.2

12.1. Enter fullscreen mode

Developers calling requestFullscreen() to enter fullscreen mode.

12.1.1. Description

The enter fullscreen function is executed asynchronously and return a Promise object.

12.1.2. Enter fullscreen API

wakool.requestFullscreen();

Example

wakool.requestFullscreen().then(function(){
    console.log('Fullscreen mode entered.');
});

12.2. Exit fullscreen mode

Developers calling exitFullscreen() to leave fullscreen mode.

12.2.1. Description

The exit fullscreen function is executed asynchronously and return a Promise object.

12.2.2. Exit fullscreen API

wakool.exitFullscreen();

Example

wakool.exitFullscreen().then(function(){
    console.log('Fullscreen mode exited.');
});

12.3. Current fullscreen mode

Developers calling isFullscreen() to tell whether currently is in fullscreen mode or not.

12.3.1. Description

The function returns a boolean, true if currently is in fullscreen mode, false otherwise.

12.3.2. Current fullscreen mode API

wakool.isFullscreen();

Example

if (wakool.isFullscreen()) {
    console.log('In fullscreen mode');
}
else {
    console.log('Not in fullscreen mode');
}

results matching ""

    No results matching ""