[エクスプレッション]レスポンシブなタイトルベースを作る_sorceRectAtTime

テキストの文字を増減させた時にテキストベースも連動して幅調整を行わせるにはそのテキストレイヤーのレイヤーサイズをもとに調整します。

sorceRectAtTime

この式は指定したレイヤーの縦横サイズなどを計算する時に使います。使い場所はthisCompやthisLayer(“指定レイヤー名”)のあとにつづけて使う事が多いと思います。

基本的な4つのオプション

  • width
  • height
  • left
  • top

テキストとベースを連動させる場合

このように文字が増えた分だけベースも動かしたい場合はベースのスケールに記入します。

//変数nに指定したレイヤーをつなげ、その後ろに.sourceRectAtTime()を追加
 n = thisComp.layer("Motion").sourceRectAtTime();
//xはwidth.yはheightを参照する
 [n.width,n.height]

行を追加する場合

これで横の動きに対応します。縦の行が増えたりする場合はアンカーポイントにエクスプレッションを組みます。

//ベースレイヤーに、変数nにそのレイヤーの情報とsourceRectAtTime()を追加
n = thisLayer.sourceRectAtTime();
//縦横それぞれ、動いた距離を相殺させるために足します
 [n.width/2+n.left,n.height/2+n.top]

こんな風に原点からマイナス方向とプラス方向に進むのでそれぞれを足す事で原点の位置を計算できる仕組みです。

これを使えば簡単にレスポンシブデザインが作れてしまいます。是非、試してみてください。

エクスプレッションを使って快適なAE生活を^^

関連記事

コメント

  1. This paragraph offers clear idea in support of the new viewers of blogging, that actually how to do blogging and site-building.

  2. Hey there! I’ve been following your website for some time now
    and finally got the courage to go ahead and give you a shout out from Porter Tx!
    Just wanted to tell you keep up the fantastic job!

  3. Pretty section of content. I just stumbled upon your web site and in accession capital to assert that
    I get actually enjoyed account your blog posts.
    Any way I’ll be subscribing to your augment and even I achievement you access consistently fast.

  4. Fantastic website you have here but I was curious if you knew of any
    discussion boards that cover the same topics discussed in this article?
    I’d really like to be a part of group where I can get
    feed-back from other knowledgeable people that share the same interest.
    If you have any recommendations, please let me know.

    Bless you!

  5. I was pretty pleased to discover this web site. I want to to thank you for
    ones time just for this fantastic read!! I definitely loved every part of it and I have you saved as a favorite to look at new
    information on your blog.

  6. It’s appropriate time to make some plans for
    the longer term and it’s time to be happy.
    I have learn this submit and if I may I desire to
    counsel you some attention-grabbing issues or suggestions.
    Perhaps you can write next articles referring to this article.
    I desire to learn even more things about it!

  7. These are really enormous ideas in on the topic of blogging.
    You have touched some good points here. Any way keep up wrinting.

  8. Hello there! This is my first visit to your blog! We
    are a group of volunteers and starting a new initiative in a community in the same niche.

    Your blog provided us beneficial information to work
    on. You have done a marvellous job!

  9. I have to thank you for the efforts you’ve put in writing
    this website. I am hoping to view the same high-grade content by you in the
    future as well. In truth, your creative writing abilities has encouraged me to get my
    own blog now 😉

  10. Greetings from Los angeles! I’m bored at work so
    I decided to browse your website on my iphone during lunch break.
    I really like the info you present here and can’t wait
    to take a look when I get home. I’m amazed at how quick your
    blog loaded on my mobile .. I’m not even using WIFI, just 3G ..
    Anyhow, very good site!

  11. Wow, this piece of writing is pleasant, my sister is analyzing these kinds
    of things, therefore I am going to inform her.

  12. If some one wishes to be updated with latest technologies afterward he must be go to see this web site and be up to
    date daily.

  13. Everything is very open with a clear explanation of the issues.

    It was definitely informative. Your site is useful. Thanks for sharing!

  14. Good web site you have here.. It’s difficult to find high-quality writing like yours these days.

    I truly appreciate people like you! Take care!!

  15. Incredible! This blog looks just like my old one! It’s on a completely different topic but it has pretty much the
    same page layout and design. Superb choice of colors!

  16. Have you ever thought about writing an ebook or guest authoring on other blogs?
    I have a blog centered on the same subjects you discuss and would love to have you share some stories/information. I
    know my readers would value your work. If you are even remotely interested,
    feel free to send me an e-mail.

      • ym
      • 2020年 1月 09日

      Thank you for watching!

  17. I visited various sites but the audio feature for audio songs existing at
    this website is actually excellent.

  18. I could not refrain from commenting. Very well written!

  1. この記事へのトラックバックはありません。

ページ上部へ戻る