7 days of unlimited video, AE, and Premiere Pro templates - for free!* Unlimited asset downloads! Start 7-Day Free Trial
  1. Photo & Video
  2. Animation

How to Animate Text Reveal Rectangles in After Effects, Part 1

Scroll to top
Final product imageFinal product imageFinal product image
What You'll Be Creating

In this tutorial, I'm going to show you how to build a great-looking text animation treatment using Adobe After Effects. The animation is very stylish and a great way to improve the look of your project. 

What we have in our example are two bars that slide across the screen that at some point start to reveal the text. So the two bars move across from the left to right. And then the text moves across from the right to left, which creates an interesting contrast to the reveal animation.  


I'm going to show you how to build this in a way that you can modify using this ready-made comp example:

  • 1980 x 1080
  • 10 seconds duration
new compnew compnew comp

I have a background solid in here that is locked, so that I can't mess with it.

black solid lockedblack solid lockedblack solid locked

So the first thing I want to do is lay out my text using the Text Tool. Just click into the preview area and begin typing. I'm going to make sure that is right aligned.

text tooltext tooltext tool

I will pull out a guide to help me align the text to where I want it to be. This will help when you want to include another line of text underneath.


So let's duplicate the text and type in something new. Then place it underneath the original text line.

bottom textbottom textbottom text

Change the font of the text at the top to something lighter, like Regular or Light, so that it contrasts with the text underneath.

light textlight textlight text

Then the next thing that I want to do is build out those rectangles to make them nice and long. And I want to find the spot that's right in between these two layers. You can use another guide to help you do this.

another guideanother guideanother guide

Deselect your layers, grab the Rectangle Tool, and draw a rectangle. Make sure that it is only set to fill and that there is no stroke.

rectangle toolrectangle toolrectangle tool

If you need to adjust the size of the rectangle, just jump into the shape properties and make your adjustments from there to get it to where you need it to be. As long as I have this guide here, this will more or less snap the shape in place for me.

Once you're happy with the shape, slide it over to the right and then create another guide on the right to help you with the spacing.

another guideanother guideanother guide

Name this Rec_1, duplicate it, and place it below the first shape.

duplicate rectangleduplicate rectangleduplicate rectangle

Next we need to design a matte so that we have mattes on the left and right of the screen. The mattes will block the text and cut off my little rectangles, making them appear out of thin air.

To do that, I'm going to use a Shape Layer. Create one that is large enough to cover the left side of the screen.

shape layershape layershape layer

Then duplicate it and slide it to the right side of the screen. Align it so that the long rectangle shapes are just peeking out.

shape on the right sideshape on the right sideshape on the right side

Grab the Anchor Point Tool and then grab the anchor point of this shape (not the layer) and move it to the outer edge of the shape.

move anchor point to the edgemove anchor point to the edgemove anchor point to the edge

Do the same thing for the other shape as well.

move anchor pointmove anchor pointmove anchor point

Open up the properties and delete the strokes from rectangle 1 and rectangle 2 as we don't need them.

delete strokedelete strokedelete stroke

Go to the Effects and Presets panel, type in "Slider Control", and add it to the shape layer.

slider controlslider controlslider control

Rename it "Right Side", and then duplicate it and rename the second one "Left Side". I'm going to set both of these values to 100.

rename the slidersrename the slidersrename the sliders

Go back to the shape properties and select the scale. This is the scale of the rectangles, not the scale of the entire layer.

Now we'll use an expression by holding Alt on the keyboard and clicking on the stopwatch icon. Then type in x =  and then use the pick whip and connect it to the right slider.

pick whip the expressionpick whip the expressionpick whip the expression

Then, at the end of the expression, add a ; and then hit Enter on the keyboard to add another line. Type in y =  and then use the pick whip and connect it to the right scale value (which will lock it at 100%).

pick whip the ypick whip the ypick whip the y

Then add a ; at the end again and hit Enter to add another line. And then add (x,y). This expression basically says that I want to set the x parameter to whatever the slider control is, and that way I'll be able to modify it without having to jump down into the layer properties and go right to the scale every time.


Now copy the expression (Control-C) and then go to the other rectangle. Open up the expression by Alt-clicking on the scale stopwatch icon, and then paste it in.

paste expressionpaste expressionpaste expression

Now we need to make a few modifications to the expression. Replace "Right Side" with "Left Side". And then change "Rectangle 2" to "Rectangle 1". And this will allow me to modify all of my mattes in this composition with this one matte control layer. You can change the name of the layer to "Matte Control" to reflect this.

edit the expressionedit the expressionedit the expression

Change the color of the layer to fuchsia so that we can easily identify it, and then duplicate it and call it "Rec Matte_1".

duplicate layerduplicate layerduplicate layer

Delete the slider controls on the Rec Matte_1 layer.

delete slider controlsdelete slider controlsdelete slider controls

Press twice on the keyboard to open up the properties and delete both expressions.

delete expressiondelete expressiondelete expression

Select the scale properties for Rectangle 2 and pick whip it to the scale properties of the same rectangle (Rectangle 2) that is within the Matte Control layer.

pick whip to scalepick whip to scalepick whip to scale

Do the same thing with Rectangle 1. Select the scale properties for Rectangle 1 and pick whip it to the scale properties of the same rectangle (Rectangle 1) that is within the Matte Control layer.

pick whip to scalepick whip to scalepick whip to scale

Hide the Matte Control layer by clicking on the eye icon.

hide layerhide layerhide layer

Select the Rectangle 1 shape layer here and make that Alpha Inverted.

alpha inverted mattealpha inverted mattealpha inverted matte

Now, when you select the Matte Control layer and adjust the Right Side slider, you can see how you can animate the top line.

animate top lineanimate top lineanimate top line

Duplicate Rec Matte 2 and place it below Rec_1 and above Rec_2. Set it to Alpha Inverted as well.

set to alpha invertedset to alpha invertedset to alpha inverted

Duplicate the Rec Matte layer one more time, place it above the text layers, and rename it Text Matte_1.

text matte 1text matte 1text matte 1

Change the top text line layer to Alpha Inverted.

top texttop texttop text

Duplicate the Text Matte_1 layer and place the Text Matte_2 layer above the bottom text line.

move above textmove above textmove above text

Change the bottom text line layer to Alpha Inverted.

bottom textbottom textbottom text

Select all the matte layers and use the pick whip to link them all to the Matte Control layer.

pick whip to matte controlpick whip to matte controlpick whip to matte control

Lock the layers by clicking on the lock icon square, which will prevent you from moving anything around in an undesirable way.

lock layerslock layerslock layers



Congratulations! You've completed Part 1 of this tutorial. In the next part of this tutorial, we'll take you through the step-by-step process of how to animate the text reveal in Adobe After Effects.

You can also check out even more tutorials below and apply them to the project.

In the meantime, I hope you've found this tutorial useful. I'll see you next time, on Envato Tuts+!

Did you find this post useful?
Want a weekly email summary?
Subscribe below and we’ll send you a weekly email summary of all new Photo & Video tutorials. Never miss out on learning about the next big thing.
Start your 7-day free trial*
Start free trial
*All Individual plans include a 7-day free trial for new customers; then chosen plan price applies. Cancel any time.