• iPhone 15 : The iPhone 15 makes up for a disappointing iPhone 14. Here's all the details.
    • iPhone 15 Pro: Going beyond the Dynamic Island, Apple's pro smartphone goes big on gaming.
    • iPhone 15 Pro Max: That periscope camera makes its debut on Apple's most-premium handset.
    • Apple Watch Series 9: With a new chip teased, it proves just an iterative year for Apple's long-standing wearable.
    • Apple Watch Ultra 2: Another modest update for Apple's top-tier rugged wearable sequel.
    • iOS 17: Our favorite new iPhone software improvements, all in one place.
    • watchOS 10: A significant upgrade for Apple's Watch software makes even older Apple Watches feel new again.

Button “play game” in preload - facebook Instant games

luizcrf

New member
May 6, 2018
1
0
0
Visit site
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?

HTML

<!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>
</head>

<body>
GAME
</body>
</html>

game.js

Code:
FBInstant.initializeAsync().then(function() {
    FBInstant.setLoadingProgress(100);
    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);
        game.state.start("Boot");
    })
})

 FBInstant.startGameAsync().then(function() {
  // Here we can be sure the player has already tapped play.
  myGame.start();
});
 

Ledsteplin

Ambassador
Oct 2, 2013
48,862
395
78
Visit site
I don't even know what you're trying to do. What is a "Facebook instant game"? Hopefully, someone else knows about this.
 

Sherry_B

Well-known member
Jan 15, 2016
2,687
0
0
Visit site
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.
 

Latest posts

Trending Posts

Forum statistics

Threads
257,235
Messages
1,754,738
Members
441,091
Latest member
Blazingheart