Will5

Members
  • Content Count

    5
  • Joined

  • Last visited

  1. Will5

    Facebook Instant Games scaling for mobile

    Hey@sathyaraj , sure thing: This was inside my JS file game = new Phaser.Game(gameWidth, gameOptions.gameHeight, Phaser.CANVAS, 'canvas', {preload: preload, create: create, update: update}); This was in my HTML: <div id="canvas"></div>
  2. Will5

    Facebook Instant Games scaling for mobile

    I'm happy to say that I found the solution. All I had to do is place the game inside a DIV container. Everything worked smoothly after that
  3. This topic has been discussed many times here, but unfortunately no solution has worked for me. I uploaded a game on Facebook Instant which works well on desktop but looks bad on mobile. Initially, I was using the following code: var game = new Phaser.Game(1080, 1920, Phaser.AUTO, null, {preload: preload, create: create, update: update}); This is the scale mode: game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; As you'd expect, I ended up with vertical white bars left and right. After days of googling and testing, I tried many other solutions which did work. I even tried using window.devicePixelRatio but I had no luck; it seems as if this code was ignored on mobile. I also tried the following but nothing worked: var game = new Phaser.Game(1080, 1920, Phaser.AUTO, null, {preload: preload, create: create, update: update}); var game = new Phaser.Game(window.innerWidth * window.devicePixelRatio, window.innerHeight * window.devicePixelRatio, Phaser.AUTO, null, {preload: preload, create: create, update: update}); So before giving up, I thought I'd ask you guys for help. Thanks in advance.
  4. Will5

    Intergrating Facebook Instant Games

    I checked his tutorials; unfortunately I'm still getting black screens when I upload my game. I noticed he put the code below inside FBInstant.startGameAsync() game = new Phaser.Game(gameWidth, gameOptions.gameHeight, Phaser.CANVAS); If I do the same, the game won't even run anymore.
  5. Hi all, I'd like to upload my game Instant Games, however I've been having a hard time applying Facebook's code to Phaser; I end up with a black every time. Let's say I have the following code: var game = new Phaser.Game(500, 500, Phaser.AUTO, null, {preload: preload, create: create, update: update}); var sprite; function preload(){ game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; game.load.image('sprite', 'img/character.png'); } function create(){ game.add.sprite(0,0,'sprite'); } function update(){ } How should I modify it to make it compatible with Instant Games? I'd really appreciate it if anyone can help me with this as I'm new to Phaser.