yougotashovel

Members
  • Content count

    18
  • Joined

  • Last visited

  1. Phaser docs - sticky header issue

    I like that the docs are now built into the official Phaser website, and i like the autocompleting search function. However the sticky header is taking up a large portion of the screen, making it annoying to read on smaller screens. The section that's sticking seems only relevant for those that repeatedly need to change which version they're reading. Which for my own case i'll select the version and then really don't need the option omnipresent, not sure how other developers are working with the docs. Example here: http://phaser.io/docs/2.4.4/Phaser.Physics.Arcade.html Just a polite suggestion that unsticking the header would make for easier reading, and keep the UX inline with the rest of the site.
  2. webview VS wrapper, cocoonjs, cordova, phonegap, crosswalk ?!

    After a lot more testing. I've found the following to be pretty consistent regardless of the amount of sprites, images, text, tweens and animations used: 1 graphics object = 60fps (as a background only, if layered on top of other objects then 35-40fps) 2 graphics objects = 35-40fps 1 graphics mask = 30fps max (no matter how many other graphics objects are used) 1 moving tilesprite = 30fps 2 moving tilesprites = 15-25fps If all masks, graphics and tilesprites are removed then i've found i can get steady 60-62fps, using Canvas+ in iOS --- EDIT --- For clarification the above was using WebGL mode. I tested again and switched to Canvas mode, and the frame rate stays around 60fps most of the time, even with some of the objects above included. For me at least i've found WebGL mode is buggier than canvas, i've found it struggles with successions of tweens, or complex tween timing. Where canvas doesn't appear to have any problems with this. I have noticed in WebGL the memory is reduced by a lot. My app was reading at 228mb, 77mb wasted on Canvas mode, in WebGL the same was 76mb with 22mb wasted.
  3. webview VS wrapper, cocoonjs, cordova, phonegap, crosswalk ?!

    @Gods I'm also getting nowhere near 60fps, at best i'm averaging around 25-29fps sometimes 40fps with Canvas+ on iOS. I don't have that many things happening on screen at any one time, largely static pages, a dozen objects per scene, some with intermittent animations, a few tweens, some text, and a few more complex transitions that drop the frame rate from time to time. Nothing i would consider particularly heavy use, although i imagine because i'm using entirely retina images and have to load a few 1-3 full spritesheets per scene that has something to do with the performance. After some tests it appears Cocoon can handle hundreds of sprites and images with tweens simultaneously with simple code applying the same tween to everything. It's when using combinations of Phaser objects, tweens and animations, in real game scenarios (not test scenarios) that performance starts to slip very rapidly. If i use any tilesprites or generated graphics that tends to drop the fps very low, so i've had to remove these almost entirely. I would also like to see an example of a project sustaining or getting near 60fps in Canvas+ with Phaser.
  4. Common Phaser + CocoonJS issues

    @ludei I've been experiencing this same issue, has there been any updates to this since december? In my case i have an audiosprite with 10 sounds, and when i call play on any part of the audiosprite it appears to play the first few-hundred milliseconds of the whole file, then the part that i have referenced. @valueerror did you find a good workaround for this yet?
  5. Loading content - frame rate drop

    Ah, okay. I'm guessing, but would you need access to different cpu cores to bypass this? I guess you can't do that in javascript. I just like moving loading screens as it feels like something is actually happening and things haven't frozen. Are there any other methods/techniques that could help or produce a similar effect? Or is the only way to have static loading screens? Cheers
  6. Loading content - frame rate drop

    I'm experiencing heavy drops in framerate when dynamically loading content, which is affecting tweens i have running. I have a loading screen that pops up and tweens a handful of objects. While the new content is loading the frame rate drops from around 40-30 to 10 or less, and causes the tweens to be really jumpy. Can anyone explain why this is occurring? Thanks
  7. Text getting cropped / cut-off - (updated issue)

    Great! This is exactly what i was looking for. I threw your code in, and that gave me a good indication of what i needed to do. I copied the PIXI text prototype, and changed line 369 from this: baseline = baseline * 1.4 | 0;To this: baseline = baseline * 1.6 | 0;1.8 is too much, it changes the cutoff to the bottom of the text. I should probably tweak the code more to get the anchors working perfect, but this is a good fix for now. Thanks so much!
  8. Text getting cropped / cut-off - (updated issue)

    Update: I have found that if i use wordWrap in the text styling, then the first line of text has the same cutoff at the top, and the font works fine for all lines below. So i think this is an issue with the bounds of the text object. 1. Is there a way to change the bounds of the text? 2. or add a padding to the text object, so the text is further away from the border of the object? I still haven't found a solution, If anybody could help it really would be appreciated. Thanks
  9. _tweens undefined on object

    Found one possible solution. this._tweens[t]._objectAbove doesn't appear to exist when passed into the console, but the below does, and works. this._tweens[t].target--- Anybody else who needs to pause tweens in a group or array, this code now works: Phaser.TweenManager.prototype.pauseGroup = function(obj, children) { var o, c, t, len; if (Array.isArray(obj) ) { for (o = 0, len = obj.length; o < len; o++) { this.pauseFrom(obj[o]); } } else if (Phaser.GROUP && children){ for (c = 0, len = obj.children.length; c < len; c++){ this.pauseFrom(obj.children[c]); } } else { for (t = 0, len = this._tweens.length; t < len; t++){ if (obj === this._tweens[t].target){ this._tweens[t].pause(); } } for (t = 0, len = this._add.length; t < len; t++){ if (obj === this._add[t].target){ this._add[t].pause(); } } }};Then just call: game.tweens.pauseGroup(group, true);For some reason resume is kinda buggy, i couldn't get it to work. If anybody figures out resume for groups, let me know. game.tweens.resumeAll(); should do the trick for now though.
  10. _tweens undefined on object

    Okay now i see that obj._tweens and obj._add don't exist. And that the script is referencing 'this' as the TweenManager. Still struggling to get it to work though. I can get log information on everything in the script except inside this loop: for (t = 0, len = this._tweens.length; t < len; t++){ if (obj === this._tweens[t]._object){ console.log(this._tweens[t); this._tweens[t].pause(); }}
  11. _tweens undefined on object

    I've been trying to extend the functionality of TweenManager, so it can resume and pause everything within a group. I adapted the code from here: http://jsfiddle.net/lewster32/L3u3gp5k/ http://docs.phaser.io/TweenManager.js.html#sunlight-1-line-127 When debugging with console, _tweens and _add are undefined for each object, so the function doesn't work. I think the code is correct? Any ideas why this isn't working? I'm guessing i've missed something crucial about _tweens. Here's the code: (This goes out to Rich and Lewster) Phaser.TweenManager.prototype.pauseAllFrom = function(obj, children) {console.log('pauseAllFrom', obj.type, obj.name, obj._tweens, obj._add); var o, c, t, len; if (Array.isArray(obj) ) { for (o = 0, len = obj.length; o < len; o++) { this.pauseFrom(obj[o]); } } else if ( (obj.type === Phaser.GROUP || obj.type==7) && children){ for (c = 0, len = obj.children.length; c < len; c++){ this.pauseFrom(obj.children[c]); } } else { for (t = 0, len = this._tweens.length; t < len; t++){ if (obj === this._tweens[t]._object){ console.log('pauseFrom _tweens:',this._tweens[t]); this._tweens[t].pause(); } } for (t = 0, len = this._add.length; t < len; t++){ if (obj === this._add[t]._object){ console.log('pauseFrom _add:',this._add[t]); this._add[t].pause(); } } }};Phaser.TweenManager.prototype.resumeAllFrom = function(obj, children) {console.log('resumeAllFrom', obj.type, obj.name, obj._tweens, obj._add); var o, c, t, len; if (Array.isArray(obj) ) { for (o = 0, len = obj.length; o < len; o++) { this.pauseFrom(obj[o]); } } else if ( (obj.type === Phaser.GROUP || obj.type==7) && children){ for (c = 0, len = obj.children.length; c < len; c++){ this.pauseFrom(obj.children[c]); } } else { for (t = 0, len = this._tweens.length; t < len; t++){ if (obj === this._tweens[t]._object){ this._tweens[t].resume(); } } for (t = 0, len = this._add.length; t < len; t++){ if (obj === this._add[t]._object){ this._add[t].resume(); } } }};I also had to add a condition for the object type, as the console wasn't recognising Phaser.GROUP, and spitting out a number for each object type. // from thiselse if (obj.type === Phaser.GROUP && children){// to thiselse if ( (obj.type === Phaser.GROUP || obj.type==7) && children){Any help would be greatly appreciated. Thanks
  12. Check if group is out of bounds

    I'm trying to check if a whole group is outside of the visible bounds, so i can process it for cleaning up memory. I've got my world bounds set to this: var w = window.innerWidth, h = window.innerHeight;game.world.setBounds(0, 0, w, h);I've tried a few things, but i guess what i'm looking for is something like "group.events.onOutOfBounds()" I realise this doesn't exist, but is there anything that would do the job? Is it possible to check if a group is out of bounds, or do i have to check everything in the group individually? Thanks
  13. _lastChild is undefined 2.2.2

    It looks like it was simplified in the latest version of Phaser to include chained tweens. tween.onComplete.add(function(){ console.log('complete');}, this);Found the solution in this topic: http://www.html5gamedevs.com/topic/11529-tween-onstart-callback-problem-in-phaser-221-works-in-204/?hl=%2Btween+%2Boncomplete
  14. _lastChild is undefined 2.2.2

    I'm getting this error too, trying to find a solution.
  15. The Phaser 3 Wishlist Thread :)

    Ahhhh, thanks. They're all named so similar, and i don't know why i didn't see the pivot property before!