• Content Count

  • Joined

  • Last visited

  • Days Won


efusien last won the day on October 7 2014

efusien had the most liked content!

About efusien

  • Rank
    Advanced Member

Recent Profile Visitors

746 profile views
  1. You can have a hidden input text field (DOM), trigger a click on it to pop the keyboard, and listen for user key press events. Then display the user inputs right in your canvas, in a "fake text field". The bad thing is you have to manage the keyboard display and user behavior (switch to portrait/landscape mode, etc) over multiple devices (IOS, Android, etc). UX job. Time consuming.
  2. Same question. Looks like the Phaser example is not working on mobile: http://phaser.io/examples/v2/input/word-input Maybe because the keyboard does not pop? Is it better to use a DOM input text and display it in the canvas? If someone has a best in class example... :-)
  3. Hi, I would like to search terms: "ios keyboard" in the Phaser forum. But I can't ! Why do we have this limit?Sounds not user friendly. Maybe there is a tip to search these terms?
  4. @beuleal Check if you are using the property fixedToCamera. It's blocking some usual transitions. See my post 17 February 2015 - 07:07 PM
  5. +1 Same issue :-( With Phaser.CANVAS mode it's working.
  6. Hi @vorrin, I tried some different ways but I don't really know if it's a great improvement. The last one is to load a sound only when needed, in a specific var. Then replace this var with a new sound if needed (destroying the old sound on the fly). So we only have 1 var for a group of sounds, with lazy loading. An other way is to load all sounds you need for a state in a specific array with keys pairing sounds ids. On a Cordova App, I use the plugin nativeaudio. But you need to have a Cordova app.
  7. As a plus, I don't recommand to use the property fixedToCamera. Instead, center the cover on the world, and use anchor to 0.5 this._cover = new Phaser.Sprite(game, game.world.centerX, game.world.centerY, texture);this._cover.anchor.setTo(0.5);This allow us to move the cover sprite for beautiful transition effects. IE: screen falling down: duration: 550,ease: Phaser.Easing.Bounce.Out,properties: { anchor: { y: -0.5 }}
  8. @yougotashovel You can add the cover sprite to the game inside the init() function to avoid flickering effect. Something like the code below can do the job: _init = this.game.state.states[state].init;// Extend state init method to add coverthis.game.state.states[state].init = function() { if (_init) { _init.call(_this.game.state.states[state]); } // Add the cover to avoid flickering effect this.game.state.states[state].world.add(_this._cover);};By the way, @aaccurso I found a bug in the plugin script. The current state create function is redefined inside the Phaser.Plugin.StateTransition.prototype.to function. See the code below: _create = this.game.state.states[state].create;// Extend state create method to animate coverthis.game.state.states[state].create = function() { if (_create) { _create.call(_this.game.state.states[state]); } // Bring the cover on top of state children this.game.state.states[state].world.bringToTop(_this._cover); _this._animateCover();};So, each time we start the state with the plugin (calling the transition plugin to function), the current state create function is redefined in a recursive way :-( A quick workaround is to save the create function the first time we use the plugin, and use this save to call it. Set a private var at the top of the plugin: var _originalFunctions = {};And save each state "create" function, only if not already defined: _originalFunctions[state] = _originalFunctions[state] || { create: this.game.state.states[state].create};Then use it like: var _create = _originalFunctions[state].create;This workaround works, but it's quite uggly. Maybe someone has a better way to do the job :-)
  9. I understand, I'm doing this in a similar way for my current game. But the goal was to use the create() function after preloading. In Project Templates we use the update() function. In this way create() is already fired. I could have my own callback(), but some third part script, such as Transition Plugin, use the create function because it's part of the Phaser framework. Plus, the onFileComplete event is usually used to display a progress bar. Using the update function() like in Projet Templates doesn't do the job. Again I can write the progress display myself, but why not use the Phaser one? Maybe I'm only in this case. It's my own wish list :-)
  10. Yes, but I need the onFileComplete event to take care of the isSoundDecoded callback, if autoDecode is true. Phaser calls the create method right after firing the onLoadComplete. I would like it calls the create method after all sounds are decoded.
  11. I ask this request because sounds on small mobile devices can take few seconds to decode. On IOS devices sound decoding is quite fast (like on desktop). But on last generation of Google Nexus or Samsung Galaxy tab the decoding takes few seconds. Average 3-4 seconds for a 250K MP3 sound file
  12. Hi, On an audio file, is there a way to fire the event Loader.onFileComplete only when the file is decoded ? Phaser states logic is based on preload and create functions. When preload is endend we call the create function. But sounds are not always decoded. Is there a way to upgrade this behavior? I would like to start the create function only when sounds are fully decoded. Please note I don't need a specific flag on my side to wait until my sounds are decoded. I need a Phaser logic here. I guess a new parameter in the Loader.audio function could do the job: game.add.audio(key, urls, autoDecode, fireFileCompleteEventOnDecoded)
  13. Yep, my mistake. I'have tried with the onLoadComplete, but the result is the same. Page crashes. The best option seems to set only a little set of sounds and overwrite them with new ones on next states. Looks like the best choice for now, but it doesn't solve the problem of destroying sounds in memory. Phaser call destroy function on state shutdown, right? So if I load only sounds for the current state, and if destroy clear the memory usage, we shoud be in business. Need to confirm. As alex_h said, I didn't try with sound.onDecoded event. Maybe we have to wait until the sound is decoded before destroying it?
  14. Does the code below removes the sound from memory? game.cache.removeSound("test");I guess not. A quick test with a 15K mp3 file, loaded 2000 times and removed on the fly: for (var i = 0 ; i < 2000 ; i++) { game.load.audio("test_" + i, "test.mp3"); game.cache.removeSound("test_" + i);}This test fail on small IOS devices: the web page refresh itself again and again.
  15. Thanks for this suggestion. I'll try. The bug appears only on IPAD mini and IPOD. On IPAD 4 it's ok. I guess it's a memory limit.