• Content count

  • Joined

  • Last visited

  1. Move world position on canvas

    Never working with setBounds yet... but 0, 0 is top left corner, have you tryed game.world.setBounds(10, 10, 400, 400)?
  2. sound.isPlaying always return true

    Good morning everyones! I'm using Phaser 2.6.2. I'm working to play a sound sequence, I've didn't find a queue option in Phaser sound manager, so I've tried to build a basic one by myself. I've 1 to 5 sounds to play one after one to make a single sound if the player has reached 1 to 5 goals. I'v all the sounds preloaded in an array. When I call: console.log(sound[i].isPlaying); is always true. When I call: console.log(sound[i].currentTime); is always 0. Why? How can I make it works?
  3. getImageSize of an image in an atlas

    Solved. game.cache.getFrameByName();
  4. getImageSize of an image in an atlas

    Hi all! How can I get the image size of an image in an atlas? getImageSize wants just a string... but tu reach the image it have to know both atlas key and image key.
  5. How to use the Phaser in Visual Studio 2017

    For Visual studio 2017 community edition you have to use this exension: TypeScript HTML Application Template (it's a really outdated template but if you start your project with it, Phaser works). HTMLTypeScriptApp.vsix
  6. How to use the Phaser in Visual Studio 2017

    What version of Visual Studio?
  7. Phaser 3 Beta 4 Released

    How is going the Phaser 3 develop? I've looked at the roadmap linked in the website and it seems to be not updated from a while. There is a Phaser 3 official release date? :-) Thanks for the hard work!
  8. load assets after preload

  9. load assets after preload

    In Phaser you could only preload assets in preload state, so if you want to load other assets after the end of stateA, you have to have another preload state where you preload your assetsB for stateB.
  10. Loading atlas

    Happy new year everyone!!!!!! I'm starting this new Phaser year with a big question. Is there a way to do at least one of those three things: Have multiple keys for just one atlasJSONarray.json { "frames1": [ { "filename": "frame_x", "frame": {"x":0,"y":0,"w":246,"h":642}, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":246,"h":642}, "sourceSize": {"w":246,"h":642} }, ... ], "frames2": [ { "filename": "frame_y", "frame": {"x":0,"y":0,"w":642,"h":246}, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":642,"h":246}, "sourceSize": {"w":642,"h":246} }, ... ], "meta": { "app": "http://www.codeandweb.com/texturepacker", "version": "1.0", "image": "frames.png", "format": "RGBA8888", "size": {"w":1904,"h":1926}, "scale": "1", "smartupdate": "$TexturePacker:SmartUpdate:7501c1db9128f0a301bfd7fdbb041683:f12b9111dd99102df2878485c54440cc:8dfa5172c304a3afa731250a934e2d8d$" } } //Load things in "frames1" with key 'spriteframe1' game.load.atlasJSONArray('spriteframe1' , 'images/frames.png' , 'images/frames.json'); //Load things in "frames2" with key 'spriteframe2' game.load.atlasJSONArray('spriteframe2' , 'images/frames.png' , 'images/frames.json'); Loading multiple atlases in just one atlasJSONarray.json { "frames": [ { "filename": "frame_x", "frame": {"x":0,"y":0,"w":246,"h":642}, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":246,"h":642}, "sourceSize": {"w":246,"h":642} }, { "filename": "frame_y", "frame": {"x":0,"y":0,"w":642,"h":246}, "rotated": false, "trimmed": false, "spriteSourceSize": {"x":0,"y":0,"w":642,"h":246}, "sourceSize": {"w":642,"h":246} }, ... ], "meta": { "app": "http://www.codeandweb.com/texturepacker", "version": "1.0", "images": ["frames1.png", "frames2.png"], "format": "RGBA8888", "size": {"w":1904,"h":1926}, "scale": "1", "smartupdate": "$TexturePacker:SmartUpdate:7501c1db9128f0a301bfd7fdbb041683:f12b9111dd99102df2878485c54440cc:8dfa5172c304a3afa731250a934e2d8d$" } } Have the same key for two different atlases who have data for the same sprite/sequence/animation/any //Load all the frames in both files for my animation game.load.atlasJSONArray('spriteframes' , 'images/frames1.png' , 'images/frames1.json'); game.load.atlasJSONArray('spriteframes' , 'images/frames2.png' , 'images/frames2.json'); Is it possibile at least one of this three things? If yes, how? Thanks for the answers guys!
  11. Best Typescript/Phaser IDE?

    Visual Studio is the best to code in Typescript right now. To work with Phaser you have to fight for a while (at lest with Visual Studio community 2017)... but after the fight you can code without any problem and you will have Intellisense (if you remind yourself to declare the type of anything).
  12. Preferred Language for Phaser?

    I prefer Typescript.
  13. No problem, the clearest you are the easiest is to answer you for those who are reading Sorry I couldn't be more helpfully... I'm not already yet at this point with my project :-(
  14. Mmm... maybe you could try wich one of the two types of resize you can use in Phaser: // Stretch to fill game.scale.scaleMode = Phaser.ScaleManager.EXACT_FIT; //Stretch until one of the side touch the screen border game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; It seems that you are now using the second one (who is te default value). You even want to rotate all the stage or just change it's size?
  15. I'm just a jerk... solution found! The second one is the one it works... with a little correction. let sounds_jukebox: { sound: Phaser.Sound }[]; function jukebox(): void { sounds_jukebox = [ {"sound": game.add.sound('key1')}, {"sound": game.add.sound('key2')}, {"sound": game.add.sound('key3')} ] } sounds_jukebox[key1].sound.play(); sounds_jukebox[key2].sound.isPlaying(); sounds_jukebox[key3].sound.stop(); So, placing a jukebox() in app.ts, game is defined when I call sounds_jukebox! Thanks @samme, I own you a beer!