rich Posted July 10, 2015 Share Posted July 10, 2015 Hi all, Just wanted to say that RC1 of Phaser 2.4 is now available for download. More details here: http://phaser.io/news/2015/07/phaser24-rc1 This is a pretty massive update with a load of great new features and fixes. The change log seems to scroll on for ever Please give it a test - pay attention to the "deprecated" list in the change log too, as some things have now been removed. But it'd be great if you could drop it into your game and give it a test please. You'll find loads of new examples in the examples repo too, showing off things like video playback and Text tabs. Feel free to post issues here or on github. Cheers, Rich Lonan, clark, george and 1 other 4 Link to comment Share on other sites More sharing options...
wayfinder Posted July 11, 2015 Share Posted July 11, 2015 This update (from 2.3) is screwing with my mouse code something awful. I am not sure what that is about—I suddenly get all kinds of race-condition-type problems that weren't there before. edit: to be more precise: mouseMoveCallbacks are suddenly being executed at a time when the changes made in an onMouseDown handler haven't taken effect yet (so I click on a sprite, the onMouseDown handler sets a flag, but the mouseMove doesn't see that flag as set, only in the next frame). This was not how things were in 2.3... Link to comment Share on other sites More sharing options...
stupot Posted July 12, 2015 Share Posted July 12, 2015 Works for me. Link to comment Share on other sites More sharing options...
MikeT Posted July 13, 2015 Share Posted July 13, 2015 Having an issue with tiling an 1136x640 sprite. It basically doesn't tile and cuts it off and makes it into a 630x400 size piece. My code looks like this:land = this.add.tileSprite(0, 0, this.world.width * 2, this.world.height, 'bgLights'); I've also tried this and get the same result:land = this.add.tileSprite(0, 0, 1136 * 2, 640, 'bgLights'); I'd basically just have it tile to the right once so I could just have it scroll endlessly, and now it's just cut off on both the top and bottom, and doesn't fill the screen (which is matched to the size at 1136x640). When I resize the game it'll change dimensions as well, so resizing it can't actually fit it because it will always be cut off. Can't use scale to try and bandage the issue either because the aspect ratio is also different. It does tile, but there's large gaps. I can also no longer use fontSize to change the size of BitmapFont objects after they've been created. These are the only two things I've run into plopping the 2.4 RC1 into my 2.3 game. Link to comment Share on other sites More sharing options...
rich Posted July 13, 2015 Author Share Posted July 13, 2015 What is the size of the source image? If it's not a power of two then it won't tile seamlessly in WebGL and you'll see gaps. Also a TileSprite should never be larger than the size of the screen / canvas. It's just pointless and wastes memory - scroll it, don't make it huge. I've seen lots of devs do this so I'm wondering where the misconception is coming from, will have to recheck the tilesprite examples and see if any of those do it by mistake. Link to comment Share on other sites More sharing options...
MikeT Posted July 13, 2015 Share Posted July 13, 2015 What is the size of the source image? If it's not a power of two then it won't tile seamlessly in WebGL and you'll see gaps. Also a TileSprite should never be larger than the size of the screen / canvas. It's just pointless and wastes memory - scroll it, don't make it huge. I've seen lots of devs do this so I'm wondering where the misconception is coming from, will have to recheck the tilesprite examples and see if any of those do it by mistake. It's 1136x640, the exact size of the screen / canvas. Its width is doubled so I can tween the scrolling to be endless and it's really just a very detailed background. I'll try to look for other ways to accomplish this now with the change in 2.4. Link to comment Share on other sites More sharing options...
rich Posted July 13, 2015 Author Share Posted July 13, 2015 You can use TileSprite.tilePosition and tween those values to achieve the same effect - then you don't need to create a huge sprite. However I think you've identified a bug anyway - even in webgl it should still never scale the TileSprite *down*. So I'll look at that now. MikeT 1 Link to comment Share on other sites More sharing options...
wayfinder Posted July 13, 2015 Share Posted July 13, 2015 This update (from 2.3) is screwing with my mouse code something awful. I am not sure what that is about—I suddenly get all kinds of race-condition-type problems that weren't there before. edit: to be more precise: mouseMoveCallbacks are suddenly being executed at a time when the changes made in an onMouseDown handler haven't taken effect yet (so I click on a sprite, the onMouseDown handler sets a flag, but the mouseMove doesn't see that flag as set, only in the next frame). This was not how things were in 2.3... ...I've identified what's going wrong (longer discussion is over on github): my onInputUp handler cannot reliably tell which button was released to trigger the onInputUp event. If anyone has a 100% working technique to find out that information, please please let me know! Link to comment Share on other sites More sharing options...
rich Posted July 13, 2015 Author Share Posted July 13, 2015 re: mouse buttons. Yeah it's possibly by checking the buttons bitmask, but it's a bit convoluted. I'm tempted to split 'Button' out to be its own class, rather than a boolean within Pointer - because now buttons are dealt with accurately it means you could for example flag an object to only be dragged with the left button, or only clicked with the right button, etc. Link to comment Share on other sites More sharing options...
wayfinder Posted July 13, 2015 Share Posted July 13, 2015 Yes, that's kind of what I'm trying to do.. dragging with the LMB, deleting with MMB, doing nothing when RMB is used. Can you perhaps point me to where I can read the event data from within my onInputUp handler? It only gets passed the object and the pointer, and I can't find the event itself. Link to comment Share on other sites More sharing options...
icp Posted July 13, 2015 Share Posted July 13, 2015 Is there any performance improvement? Link to comment Share on other sites More sharing options...
wayfinder Posted July 13, 2015 Share Posted July 13, 2015 So, turns out event.button is useful after all and contains the actual button that was released... details in the github issue! Link to comment Share on other sites More sharing options...
fariazz Posted July 13, 2015 Share Posted July 13, 2015 Tested in 14 games and they all work like a charm. Very glad to have the Health component issues fixed, also collisions and everything in arcade and p2 working good. Thanks heaps Richard and the community! Link to comment Share on other sites More sharing options...
rich Posted July 14, 2015 Author Share Posted July 14, 2015 @fariazz - thanks for taking the time to test! Link to comment Share on other sites More sharing options...
substandardgaussian Posted July 14, 2015 Share Posted July 14, 2015 The first thing I noticed on switching to the RC is that my sprites no longer loop their animations. I know the animation is correct because I see the sprites change exactly once (2 frame animation). After that, the console indicates that currentAnimation.loop is true AND that currentFrame.name changes from "0" to "1" and back at the right rate, and the currentAnimation.loopCount increases like it should, but visually, nothing changes after the first loop. All the sprites are stuck in the second frame of their animations forever. Everything about it looks right besides the actual rendering. Link to comment Share on other sites More sharing options...
rich Posted July 14, 2015 Author Share Posted July 14, 2015 Ahh - that was the key (2 frame looped animation). This is now fixed in the dev branch Link to comment Share on other sites More sharing options...
substandardgaussian Posted July 14, 2015 Share Posted July 14, 2015 Yep, that did it, thanks! Link to comment Share on other sites More sharing options...
mwatt Posted July 15, 2015 Share Posted July 15, 2015 I'm getting these errors in the console using the latest dev minified version: WebGL: INVALID_VALUE: texImage2D: no canvas253index.html:1 [.WebGLRenderingContext-000000EF96B4F160]RENDER WARNING: texture bound to texture unit 0 is not renderable. It maybe non-power-of-2 and have incompatible texture filtering. The game plays fine ostensibly. I do not see these errors with 2.3 (non minified). I really haven't tried to figure out the issue yet. Just reporting it for now, let me know if you want me to try and dig in. Link to comment Share on other sites More sharing options...
rich Posted July 15, 2015 Author Share Posted July 15, 2015 @mwatt - which browser? Link to comment Share on other sites More sharing options...
mwatt Posted July 15, 2015 Share Posted July 15, 2015 Version 46.0.2455.0 canary (64-bit) Link to comment Share on other sites More sharing options...
rich Posted July 17, 2015 Author Share Posted July 17, 2015 Ok RC2 is now up for testing! Full details here: http://phaser.io/news/2015/07/phaser24-rc2 Link to comment Share on other sites More sharing options...
Recommended Posts