Zaloguj | Zarejestruj | FAQ

Add button facebook Instant games

+ Odpowiedz

Posty: 1 Strona 1 z 1

Add button facebook Instant games

przez luizcrf » Wt maja 08, 2018 6:59 am

Hello, I'm developing a game for the facebook instant games platform and I need to add a preloader in the
using the API.
I did everything correctly, but I'm having trouble adding
the blue "play now" button (Image: ) to make the game start only after
the user clicks this video button: https: //

Anyone who knows the facebook api could tell me the correct way to add this button?


Kod: Zaznacz cały
<!DOCTYPE html>
<html manifest="offline.appcache">
<head><script src=""></script>
        <script src = "game.js"></script>



Kod: Zaznacz cały
FBInstant.initializeAsync().then(function() {
    Module._fbinstant_inited = true;
    FBInstant.startGameAsync().then(function() {
        var windowWidth = window.innerWidth;
        var windowHeight = window.innerHeight;
        if(windowWidth > windowHeight){
            windowWidth = windowHeight / 1.8;
        var gameWidth = windowWidth * gameOptions.gameHeight / windowHeight;
        game = new Phaser.Game(gameWidth, gameOptions.gameHeight, Phaser.CANVAS);
        game.state.add("Boot", boot);
        game.state.add("Preload", preload);
        game.state.add("TitleScreen", titleScreen);
        game.state.add("PlayGame", playGame);

FBInstant.startGameAsync().then(function() {
  // Here we can be sure the player has already tapped play.
Avatar użytkownika


  • Posty: 1
  • Dołączył(a): N maja 06, 2018 10:20 pm

+ Odpowiedz

Strona 1 z 1