Skip to main content
Participant
July 20, 2021
Question

アンカーポイントを中央で固定させたいです。

  • July 20, 2021
  • 1 reply
  • 5235 views

スライダー制御でカウントダウンを作りたいのですが、下の写真のように初めの0のアンカーポイント位置で固定されてしまいます。

常にアンカーポイントが中央に来るようにして、数字が真ん中からズレないようにしたいのですが解決法はありますでしょうか。

 

 

1 reply

Community Expert
July 20, 2021

下記のエクスプレッションをテキストのアンカーポイントに追加してください。

let w = thisLayer.sourceRectAtTime().width;
let h = thisLayer.sourceRectAtTime().height;
let t = thisLayer.sourceRectAtTime().top;
let l = thisLayer.sourceRectAtTime().left;
[l + w / 2, t + h / 2]