Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
KineticJsで、テキストシェイプの文字列のテキスト幅を返す方法または回避策はありますか?
キャンバス上に TextShape を正確に配置する必要があります。
Kinetic.Text には、これを行うための getTextHeight() および getTextWidht() メソッドがあります。
これはあなたを助けるかもしれません。テキストの幅を取得する方法を示しています。複数行のテキストに対してこれを行う方法を示す別の例へのリンクもここにあります。