言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

RectTransform.SetSizeWithCurrentAnchors

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual
public function SetSizeWithCurrentAnchors(axis: Axis, size: float): void;
public void SetSizeWithCurrentAnchors(Axis axis, float size);
public def SetSizeWithCurrentAnchors(axis as Axis, size as float) as void

Parameters

axis サイズを指定する軸
size 指定された軸に沿った望むサイズ。

Description

RectTransformで計算されたレクタングルが指定された軸上で任意のサイズにします。

このメソッドは現在のアンカーで指定されたサイズを生成します。親RectTransformがサイズを変更した場合、レクタングルのサイズが変更されることがあります。サイズを留めておくことにしたい場合、RectTransformアンカーをストレッチしないように設定するか、このメソッドで親サイズを変更する度に呼び出す必要があります。