md_lasalle

Members
  • Content Count

    27
  • Joined

  • Last visited

About md_lasalle

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. md_lasalle

    ParticleEmitter.js questions

    Hey guys, been playing around with Phaser 3 lately and I love it! I've enhanced the particle editor example so that i can save/load and play with more of the emitter's properties. I've noticed that the maxParticles property is only taken in consideration if I put the emitter "on" to false, wait for all particles to die, and then set "on" to true again. Looking at the source, I may have found a small bug (ParticleEmitter.js line 1705, Phaser version 3.13.0) : atLimit: function () { return (this.maxParticles > 0 && this.getParticleCount() === this.maxParticles); } the last test should probably be this.getParticleCount() >== this.maxParticles so that the emitter stops emitting until it gets below the new maxParticles value. Thoughts?
  2. Hi all, I was trying to optimize our mobile experience, so instead of including a big background image in on of my texture sheets, I've made it into a simple .jpg image and set that as a CSS background with the following properties : body { margin: 0; padding: 0; background: url('assets/images/bg.jpg') no-repeat center center fixed; background-position: 50% 100%; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; height: 100%; overflow: hidden; } On iOS and desktop Chrome + Safari, the behaviour is as expected, but on Android Chrome, it seems to affect my Canvas size, as if the canvas was bigger than the whole screen. The weird thing is as I hit refresh multiple times, the behaviour changes from having correct canvas size to incorrect. If there is no way around that, I'm just going to go back to my background being part of my texture atlases. Thanks for any input! Edit: after playing around a bit with how I create Phaser's game object, I just realized that Android does not treat screen density like iOS does (ie. Retina vs xhdpi etc), so I basically added code so that on Android width and height are "100%" with a scale mode of RESIZE, and on iOS width and height are window.innerWidth * window.devicePixelRatio with a scale mode of SHOW_ALL and everything seems to behave correctly now. Let me know if you see any issues with my approach, thanks!
  3. md_lasalle

    Sound problem IOS (Ipad)

    So far so good, I’m going to keep testing on multiple iOS devices. Thanks!
  4. md_lasalle

    Sound problem IOS (Ipad)

    This was shown after I hit the issue again : Mute on pause: true Using: Web Audio - Suspended Touch locked: false All my sounds are triggered in a button "onUp" function. It seems that after I have pressed several sounds, it starts working (Web Audio becomes running)...
  5. md_lasalle

    Sound problem IOS (Ipad)

    I have been noticing issues as well, I'm testing with an iPhone SE on iOS 11.2.2 (latest version) in Safari, and the first time I visit my game, no sound at all can be heard, if I hit reload, sounds works as expected. The issue in not present on Android with Chrome. Edit: Phaser is 2.10.0, but I have seen this issue with all releases I have tried (2.6.2 and up) Edit2: trying the approach suggested in this post ( http://www.html5gamedevs.com/topic/19156-ios-92-sound-broken/ ) I was able to fix my issue on my iPhone, but on iPad running iOS 9.3.5, I still need to reload the page to get sounds. Edit3: spoke too soon, issue still showing up randomly on my iPhone, and reload of the page always fixes the problem.
  6. md_lasalle

    Disabling the Phaser.Component.PhysicsBody on objects

    Thanks Sammy, my frame time spent on scripting and rendering is now below 4ms, extremely smooth 60fps was my target, and you helped me get there. Also just throwing it out there, I discovered that accessing the width/height property of a group/sprite was causing an updateTransform call every time! Caching this value was one of the biggest gain I got.
  7. md_lasalle

    Disabling the Phaser.Component.PhysicsBody on objects

    Still spending more time than I'd like (I use a LOT of groups)
  8. Hey guys, I was profiling my game and it seems like I could save some cpu time if I could bypass this function call in my objects' postUpdate : postUpdate: function() { ... if (this.components.PhysicsBody) { Phaser.Component.PhysicsBody.postUpdate.call(this); } ... } My question is, since my game doesn't use any physics at all, do I have to rebuild phaser without physic support? Or is there a simpler way to simply disable the creation of physics body on all my game objects? Thanks for any input!
  9. md_lasalle

    Tinting TileSprite in Canvas

    Sorry to resurrect an old topic but I'm running into the same issue here : WebGL tinting works great with the tweenTint function suggested in the above posts, but when in Canvas rendering mode, the colouring seems buggy. I could probably modify the function to change the text's style if canvas mode is detected. Would this be the correct approach to bypass this issue?
  10. md_lasalle

    Controlling rendering of sprites

    Good to know, that would defeat the purpose of this whole optimization I will most likely go with your second approach, just make a pass in the render function to render text separately. I'm guessing that Phaser.Text objects are simply fonts being baked into separate textures? Wouldn't it be awesome to have Phaser create an atlas from all the text objects.
  11. md_lasalle

    Controlling rendering of sprites

    This is exactly what I was looking for, thanks samme.
  12. md_lasalle

    Controlling rendering of sprites

    Hello everyone, I have a case where I have lots of sprites on screen and each sprite has a Phaser.Text attached to it. Right now, I'm rendering in this order : renderSprite -> renderText, renderNextSprite -> renderNextText, thus having to flush the context every time I draw the text since it's not using a common sprite atlas. What I'd like to do is : renderAllSprites -> renderAllTexts So my question is, is there a way to tell Phaser not render any of these objects, and in the render() function of my current state, call what to render manually ? I'm opened to other suggestions, but please bear in mind that I cannot switch to bitmap fonts due to the fact that I need to support many languages. Thanks.
  13. md_lasalle

    Releasing a Phaser game

    Ok great, let me know if you have any tools you recommend. I'm actually using 3 2048x2048 texture atlases, but in my game, at some point I'm displaying items with a text label below them. I need a way to control the rendering of items manually. So instead of doing renderItem -> renderText, renderNextItem -> renderNextText. I'd need to do renderAllItems -> renderAllTexts. Which would minimize the amount of context flushes needed to render. I know that you can override a state's render function, and make sprites renderable to false, but is there a way for me to actually call mySprite.render() and decide the render order from there? I'd like to stay away from bitmap fonts since I need to support lots of languages.
  14. md_lasalle

    Releasing a Phaser game

    Hey guys, I'm about to release a game made with Phaser 2.8.2 targeting Desktop browsers. I was wondering if there's anything I need to do to make sure the code runs as optimized/smooth as it can on players browser? In native world, I would simply create a "release" type build with compiler optimizations enabled. Is there such a thing? Thanks.
  15. md_lasalle

    Disabling blending

    Have you noticed any gain in performance?