Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
friendlygiraffe

Nested Blitmask

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

I think you need use "bitmap cache" option... in movieclip and mask...

Link to comment
Share on other sites

Thanks for your reply

 

So it seems I might need to add forceRecaptureBitmap = true ? I also added an update to the child tween, but it has had no affect:

 

I added

TweenMax.to(cmc, 6, {x:100, y:100, onUpdate:bm.update});

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

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

 

Is multiple BlitMask'ing possible? Would you be able to get a transparant background or would it have to be a rectangle?

 

Thanks

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.
×