lundeholm Posted October 31, 2014 Share Posted October 31, 2014 I started learning Pixi yesterday and have learnt a lot already, but today I came across my first problem that I can't solve. I'm making a board game and will be relying on cacheAsBitmap to speed up the drawing of the board which may contain hundreds of static sprites. I also need a rectangular mask on the board so that I can zoom in and out and move the board around inside the masked area (I already got this working). First of all, the hit areas seems to get displaced when toggling the cacheAsBitmap a few times on a DisplayObjectContainer. Hovering the mouse over the board make the cursor change between a normal cursor and the pointing hand (buttonMode=true) in seemingly random places. Even worse is that when applying a mask, everything changes position and sometimes even disappears. I haven't been able to find a pattern in this behavior so it's hard for me to explain whats going on. Instead take a look at this jsfiddle where a bunch of rectangles are masked in the center of the canvas: http://jsfiddle.net/yyqjumvb/ Clicking the canvas will toggle cacheAsBitmap and after doing it a couple of times everything disappears or moves randomly. If I remove the mask, everything works as expected (though the first problem with wrong hit areas remains). Am I doing something wrong here or could this be a bug (or two)? I'm using Google Chrome v38. /Filip Quote Link to comment Share on other sites More sharing options...
lundeholm Posted November 1, 2014 Author Share Posted November 1, 2014 I have tried to isolate the problem further. Here is a jsfiddle that shows how cacheToBitmap fails even without masking: http://jsfiddle.net/jt6u4rhj/ Quote Link to comment Share on other sites More sharing options...
Sebi Posted November 1, 2014 Share Posted November 1, 2014 Good catch, I already know what is causing the issue. I will fix this later this day. lundeholm 1 Quote Link to comment Share on other sites More sharing options...
lundeholm Posted November 1, 2014 Author Share Posted November 1, 2014 Excellent, I look forward to it! Quote Link to comment Share on other sites More sharing options...
nick-brown Posted April 7, 2015 Share Posted April 7, 2015 Sebastian - was this fixed - I'm also having problems with cacheAsBitmap once masking is enabled? (Happy to provide more info once I've come up with a simplified example) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.