NewGuy

Members
  • Content Count

    32
  • Joined

  • Last visited

About NewGuy

  • Rank
    Advanced Member

Recent Profile Visitors

1041 profile views
  1. Hmm, my bad, looks like Pivot does still exist but it's PIXI.DisplayObject.pivot. Anywho, it'd still be interesting to hear anyone's performance related experience with Phaser.Graphics / Phaser.Images?
  2. g'day g'day I've been lurking around a few forum posts addressing anchoring with Phaser Graphics objects and why you can't do it. I gathered it was something to do with it being a lower level issue with Pixi (don't quote me on that) the solution for dealing with this seemed to come down to either using pivot or generateTexture() and loading into image / sprite. Since it looks like post 2.5.0 we've lost Phaser.Graphics.pivot, I was wondering if there was any performance loss / gain by calling generateTexture() and loading into a Phaser.Image / Phaser.Sprite and anchoring from there? I guess simply put, is it cheaper to have 10 Phaser.Graphics or 10 Phaser.Images? ( bonus points for shedding light on what happened to pivot )
  3. Seems like a nice shorthand method, yeah I know I don't need to go all out but I like the structured approach to the loader. Again, just personal preference I think at that point, not sure there's a gain/loss to either method? (if there is pls tell me)
  4. Ah thankyou! That would makes sense, my only other idea was that the JSON either didn't exist or was failing at times, hmmm ... As to how I load, my understanding was there was no actual loading going on until you called game.load.start() so my general flow is create (state started) > prepare load stack > load start > on load complete, move on to next state. That to me just seems a little more structured, probably just personal preference in the end, however.
  5. Hi all, for the record have seen a similar post before but it was quite different to my scenario. I have a pretty generic set up. I have a loading screen state where I subscribe to the onLoadComplete signal which 99.9% of the time seems to be running fine. However, over night I had a Raygun (error reporting tool) error pop up with one of our users managing to get a null version number! It is loaded like so ... public create() { this.game.load.onLoadComplete.add(this.loadComplete, this); this.game.load.json("buildInfo", "assets/json/buildinfo.json"); ... } ... public loadComplete() { buildInfo = this.game.cache.getJSON("buildInfo"); Raygun.setVersion("somegame_" + buildInfo.version); ... } The error occurs at "Raygun.setVersion("somegame_" + buildInfo.version);" as buildInfo is undefined. I assume this is some silly load time thing, or perhaps something to do with the way I use getJSON? It's a rare occurrence but it has happened! thought I'd see if anyone with a deeper knowledge of Phaser could fire a few possibilities my way. Thanks!
  6. Not quite @Arcanorum! It was a weird scenario. I was building a class that took any Phaser.Button as a parameter and draws the progress arc around the button. The idea was to allow you to tap the button or do another action that would fill the progress bar and fire off the targeted button's callback when the bar was full. My original issue was I didn't have visibility of the targeted button's callback BUT I found out through reading the Phaser source that the callback is added to the inputUp signal be default. <wall/>
  7. NewGuy

    button help!

    var button = this.game.add.button(game.world.centerX, 500, 'button', action, this, 0,0,0); button.scale.setTo(0.5); function action() { move(); } function move(){ alert("button pressed"); tweenA = game.add.tween(wr1).to({x:400}, 2000); } Try this? Kinda hard to know where you're working from
  8. Pardon me, it's a long story but I'm working with a workmate's old code and he wrote a middle class that changed the signal used for calling the callback. Samme's method does work.
  9. Hey, samme. I managed to get as far as 'btn.onInputUp.dispatch()' by looking at the source. Unfortunately yours didn't work, hmmm if (callback !== null) { this.onInputUp.add(callback, callbackContext); } And as far as I could tell it looks like you'd just need to call dispatch since it has the function and the context right? Something missing
  10. Probably a silly question, I'm wondering if there's a way to get a Phaser.Button to fire off it's callback externally? I'm basically writing a wee class with a progress bar that attaches to Phaser.Button's and when the progress bar is full, I'd like it to provoke the button to call it's callback. Any ideas? (My next plan was making an extension of Phaser.button that's hold a reference to the button's callback but I'd like to avoid doing that)
  11. I don't believe Phaser has anything like this built in, however I found a couple of plugins that might be what you're looking for. http://jdnichollsc.github.io/Phaser-Kinetic-Scrolling-Plugin/ http://zynga.github.io/scroller/
  12. Yes, thankyou @mattstyles @sammethat was helpful. I'll get debuggin I guess!
  13. Hmmm, already using CANVAS renderer
  14. Hello again, all. Started project recently which seems simple enough and difficult to screw up, however, on our Apple devices I'n noticing over about the period of 30 minutes or so, the frame rate drops from 60 to under 20! I'm keeping an eye on instances in the world and they don't increase over time. I thought I had it well contained but it would appear I was wrong. I guess my questions is, what other things need manual keeping? My sprites/images are well contained I believe, could sounds not being destroyed be the cause? Cheers for any help
  15. Cool, thanks. Is there any decent method for detecting when audio is decoded? We obviously have the onLoadComplete signal but it's always been problematic say, when kicking up a music file straight after the loading screen. It would be cool to factor some decode time accurately into load time.