jonbon

Members
  • Content Count

    9
  • Joined

  • Last visited

  1. Got it. Thanks for clarifying guys!
  2. Hi, Im wondering what the difference is between Spritesheets and Atlases? I know that Spritesheets have to have a fixed frame size but in the context of creating an animated sprite, you could achieve this with either a Spritesheet and an Atlas. Is the advantage of a Spritesheet that you don't have to name all the frames which could get tedious with large animations? Thanks
  3. Thanks Rich. I can imagine you are stacked with much higher priorities. I have taken a look at the link you gave and wanted to try this workaround. The concept makes sense and is the same idea that is talked about here: http://www.html5rocks.com/en/tutorials/canvas/hidpi/ So, I tried a little test on a plain canvas (not using Phaser) and just drew a high-res image and it works correctly, showing a crisp image on my retina macbook. I then tried creating a very basic Phaser demo with dimensions 480x320px. The game just loads a simple image of a dog. On normal displays, the image loaded is 480x320px and on retina displays it is the high res version at 960x640px. The key lines of code are here: /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Init var game = new Phaser.Game(480, 320, Phaser.CANVAS, 'gameContainer'); //Game State this.game.canvas.width *= window.devicePixelRatio;this.game.canvas.height *= window.devicePixelRatio;this.game.canvas.style.width = '480px'this.game.canvas.style.height = '320px';this.game.canvas.getContext('2d').scale(window.devicePixelRatio,window.devicePixelRatio); //load the dog imagevar sp = new Phaser.Sprite(this.game,0,0,'dog-ret');sp.width = 480;sp.height = 320;this.add.existing(sp);///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// The problem I am having is that the call to 'this.game.canvas.getContext('2d').scale' doesn't seem to do anything. I can put any value here and it has no effect. This means that on retina displays, the dog image appears to be only half the width and height of the canvas. It's this scale call that is needed to scale everything back up, as described in the other forum post, but I'm not sure why it doesn't work using Phaser? Any ideas to help? Thanks
  4. jonbon

    Retina Graphics

    Ah, didn't see that. Thanks
  5. But unless I'm mistaken, even with a conditional switch this would just load in a different set of graphics. The graphics would still appear too big on retina display's when added to sprites etc if there is nothing built into the engine to handle retina graphics?
  6. Ah, ok, it would be quite useful to be able to use an atlas frame as a repeatable image but at least I now know i'm not missing something. Thanks.
  7. Hi, I think there is a bug with TileSprite when using a frame of a sprite atlas instead of a single image. When I try to do this, the whole sprite atlas gets repeated instead of the desired frame. So when I do: this.game.add.tileSprite(0, 0, 800, 600, 'generalAtlas','pitchTexture1.png'); I get the whole atlas repeating. I checked that it's not a problem with my atlas by trying the same thing but in a regular Sprite: this.game.add.sprite(0, 0, 'generalAtlas','pitchTexture1.png'); This works fine. Is this a bug? Or am I doing something wrong? Thanks
  8. jonbon

    Retina Graphics

    Hi, Does Phaser support supplying high resolution graphics (@2x) for retina displays? I cant find any information on this. If so, how do you go about implementing this? Thanks