• Content Count

  • Joined

  • Last visited

  1. Hi all, I have an app I am working on that almost done and looks nice on my phone (Samsung Note 4). However, my scaling technique is not working on all phones, leaving some screens looking like this pic attached (hope you can see the white border around the off-white screen! The pic is HTC One X. Similar issues on tablets). My code setup is pretty simple: index.html file: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Title</title> <script src="js/phaser.min.js"></script> <script src="js/main.js"></script> </head> <body> <center><div id="game"></div></center> </body> </html> Sizing inside of main.js: var w = window.innerWidth * window.devicePixelRatio; var h = window.innerHeight * window.devicePixelRatio; var game = new Phaser.Game( w, h, // Width, height of game in px Phaser.AUTO, // Graphic rendering "", { preload: preload, // Preload function create: create, // Creation function update: update } // Update function ); I'm resizing screen elements according to w and h, so everything is designed to respond to w/h. Is this a problem with my div structure? I tried completely removing the html file... using canvas introduces a whole new host of problems though, with scale still unresolved (in canvas either does not show up or appears too large). Also tried changing the div name, using other techniques like: w = (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth) * window.devicePixelRatio; I can't seem to figure out how to get this to fullscreen. I am using WebView+ (not canvas), and min android version is 2.3. Help appreciated
  2. I'm having trouble using Phaser's TileMap.shuffle. When I use it, it shuffles the area of tiles like it should, but the tiles lose their unique properties after being shuffled. Is there some way I can shuffle tiles without losing collision properties? I'm using shuffle like this: myTileMap.setCollision(tileID, true, layer); // set a few collisions myTileMap.setTileIndexCallback(tileID, function (player, tile) { // I have two callbacks // do stuff myTileMap.shuffle(tile.x, tile.y, 5, 5, layer); // call shuffle }, game, walls); When the callback runs, the 5x5 area on the map loses its specific tile properties. Inside the callback, I can re-set the collision tiles, but I can't rewrite the callback I am in. Is there another way I should be going about achieving this? Thank you.