Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
6 Views

Phaser game gets stretched inside emulator

My game is not properly stretched inside Intel XDK emulator

It is a Phaser 2.2.2 game but I haven't used Intel XDK template for Phaser games. The strange thing is, live layout mode and even when I install the apk on my Nexus 7 device, the game properly fits inside viewport.

The game size is 720 x 480.

What should I do to the emulator or to my game code to improve this?

SI-IntelXDKEmulator.png

 

Tags (2)
0 Kudos
5 Replies
Highlighted
Employee
6 Views

does it look different in landscape vs portrait mode?  You can change that in the emulator with the buttons next to the blue "back" button.

 

0 Kudos
Highlighted
Beginner
6 Views

Strangely in landscape the game its not stretched or squeezed. 

Just to note, I haven't included init-dev.js neither app.js. Does this has something to do with this issue? I am including phaser.min.js like any other js script and I have my own custom made application structure. 

I have init() function which creates game object and initializes all things on "DOMContentLoaded" event. 

SI-IntelXDKEmulator2.png

0 Kudos
Highlighted
Beginner
6 Views

I haven't tried Debug mode but now i did and I have two screen-shots which also show strange behavior. Event with these settings: 

This code inside all android config files:

<platform name="android">
    <!-- below requires the splash screen plugin -->
    <!-- docs: https://github.com/apache/cordova-plugin-splashscreen -->
    <preference name="SplashMaintainAspectRatio" value="false" />
    <preference name="windowSoftInputMode" value="adjustPan" />
    <preference name="configChanges" value="orientation|keyboardHidden" />
    <preference name="loadUrlTimeoutValue" value="700000" />
</platform>

And this is in index.html

<meta name="viewport" content="width=device-width, height=device-height, maximum-scale=1, initial-scale=1, user-scalable=no">

Any ideas how to prevent the keyboard to stop squeezing the game viewport?

Should I use some  sCordova plugin?

This is when the keyboard is down:

SI-IntelXDKEmulator4.png

This is when the on-screen keyboard is up

SI-IntelXDKEmulator3.png

0 Kudos
Highlighted
Beginner
6 Views

But it works well on my Nexus 7 tablet :)

DSCN0357 - small.JPG

DSCN0355 - small.JPG

0 Kudos
Highlighted
6 Views

What happens if you try using the Ionic keyboard plugin to control the behavior of the keyboard?

0 Kudos