Animated Masks in C4

117 views Asked by At

I know that it is possible to create layer masks in C4 like this:

object.layer.mask = anotherObject.layer;

Is there a known way to use an animated mask?

1

There are 1 answers

0
C4 - Travis On BEST ANSWER

Yes. You can animate a mask in a couple of different ways.

First, if you use basic shapes as the object whose layer will become the mask, you can animate them as a you would normally and this becomes an animated mask.

This can be done for any visible object in C4 (i.e. shapes, movies, images, etc...).

For instance:

object.layer.mask = aShape.layer;

aShape.animationDuration = 1.0f;
aShape.origin = CGPointMake(x, y);

The above can be done with images as well. When using images any clear parts of the image will turn out transparent in your original object.

Furthermore, there is an undocumented animatable image method, which is experimental and available only in the latest template.

Using it would look like:

NSArray *imageNamesArray = [NSArray arrayWithObjects:@"imageName01.png",...,nil];

C4Image *animatedImage = [C4Image animatedImageWithNames:imageNamesArray];

object.layer.mask = animatedImage.mask;

Essentially, this method creates an animated gif style image... But, because this method is brand new / experimental, there isn't any control over the speed of the transitions between images.