Jump to content
Search Community

Nested Blitmask

friendlygiraffe test
Moderator Tag

Recommended Posts

Hi, I am attempting to animate objects inside a scrolling clip that uses BlitMask, but it doesn't seem to work.

 

Is there a way of animating an object inside a blitmask ?

 

Here's my code:

 

var MainTL:TimelineMax = new TimelineMax();
var bm:BlitMask = new BlitMask(parent_mc, parent_mc.x, parent_mc.y, bg.width, bg.height, false);
MainTL.append(new TweenMax(parent_mc, 100, {x:-parent_mc.width+bg.width, ease:Linear.easeNone, onUpdate:bm.update}));		

var cmc:MovieClip = parent_mc.child_mc;
TweenMax.to(cmc, 6, {x:100, y:100});

Link to comment
Share on other sites

Technically, yes, you can force the recapture like:

TweenMax.to(cmc, 6, {x:100, y:100, onUpdate:bm.update, onUpdateParams:[null, true]});

However, that kinda defeats the whole purpose of BlitMask which has to do with speed. Forcing a full recapture of the target can be quite costly, so doing it every single frame is likely even more CPU-intensive than simply setting bitmapMode to false on the BlitMask (or not using it at all).

Link to comment
Share on other sites

So it would be better for me to take the graphics that are moving inside the BlitMask clip and layer them on top?

 

if you take the graphics that are constantly changing out of the BlitMask and still try to move them, you will be facing the same negative performance issues of not using BlitMask.

 

 

and yes, BlitMasks can have a transparent background (but the dimensions of the mask will always be rectangular).

You can layer BlitMasks on top of each other but again, as long as you are constantly using forceRecapture = true repeatedly on one of them, you defeat the performance benefits of BlitMask.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...