1. luizcrf's Avatar
    Hello, I added the preloader in my game using the API of facebook instant games,
    but I'm having trouble figuring out how to add the blue "play now" button Image: https://imgur.com/a/YmggUIP
    And make the game start only after the user clicks this video button: https://youtu.be / Sjj_UKX549A

    How to proceed to give this action to the game?


    <!DOCTYPE html>
    <html manifest="offline.appcache">
    <head><script src="https://connect.facebook.net/en_US/fbinstant.6.0.js"></script>
    <script src = "game.js"></script>


    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.
    05-08-2018 12:11 AM
  2. Ledsteplin's Avatar
    I don't even know what you're trying to do. What is a "Facebook instant game"? Hopefully, someone else knows about this.
    05-08-2018 10:27 AM
  3. Sherry_B's Avatar
    Yeah, that code is a bit out of my ballpark. You'll have to wait for a programmer to chime in and give you a hand with it.
    06-09-2018 04:51 PM

Similar Threads

  1. Save emails attachments images in batch not one by one
    By iMore Question in forum Ask a Question
    Replies: 11
    Last Post: 05-09-2018, 07:44 AM
  2. SOT streaming Netflix in 4G
    By recDNA in forum Ask a Question
    Replies: 3
    Last Post: 05-07-2018, 08:07 AM
  3. iMac at 20: How the all-new all-in-one ignited the modern Apple
    By iMore.com in forum iMore.com News Discussion & Contests
    Replies: 0
    Last Post: 05-06-2018, 09:40 AM
  4. If you love Donkey Kong Country: Tropical Freeze, you should try these games!
    By iMore.com in forum iMore.com News Discussion & Contests
    Replies: 0
    Last Post: 05-05-2018, 08:10 AM
  5. How to share Oculus Go screenshots and video recordings without using Facebook
    By iMore.com in forum iMore.com News Discussion & Contests
    Replies: 0
    Last Post: 05-04-2018, 06:10 PM