UDim2データ型
データ型日本語解説あり
ひとことで言うと
GUIの位置や大きさを表すデータ型です。画面に対する割合(Scale)と、ピクセル数(Offset)の組み合わせで指定します。
公式の説明(英語):Represents a two-dimensional value where each dimension is composed of a relative scale and an absolute offset.
コンストラクター(作り方)(5)
| 名前と書き方 | 説明 |
|---|---|
newUDim2.new() | 横のScale・横のOffset・縦のScale・縦のOffsetを指定して作ります。Returns a new UDim2 with the coordinates of two zero UDim components representing each axis. |
newUDim2.new(xScale: number, xOffset: number, yScale: number, yOffset: number) | 横のScale・横のOffset・縦のScale・縦のOffsetを指定して作ります。Returns a new UDim2 given the coordinates of the two UDim components representing each axis. |
newUDim2.new(x: UDim, y: UDim) | 横のScale・横のOffset・縦のScale・縦のOffsetを指定して作ります。Returns a new UDim2 from the given UDim objects representing the **X** and **Y** dimensions, respectively. |
fromScaleUDim2.fromScale(xScale: number, yScale: number) | 割合だけで作ります。Returns a new UDim2 with the given scale components and no offsets. |
fromOffsetUDim2.fromOffset(xOffset: number, yOffset: number) | ピクセル数だけで作ります。Returns a new UDim2 with the given offset components and no scaling. |
プロパティ(4)
| 名前と書き方 | 説明 |
|---|---|
XUDim2.X: UDim | The **X** dimension scale and offset of the UDim2. |
YUDim2.Y: UDim | The **Y** dimension scale and offset of the UDim2. |
WidthUDim2.Width: UDim | The **X** dimension scale and offset of the UDim2. |
HeightUDim2.Height: UDim | The **Y** dimension scale and offset of the UDim2. |
メソッド(1)
| 名前と書き方 | 説明 |
|---|---|
LerpUDim2:Lerp(goal: UDim2, alpha: number): UDim2 | Returns a UDim2 interpolated linearly between the value and the given goal. |
英語の説明とメンバーの一覧は、Roblox Creator Documentation(UDim2)をもとにしています(CC BY 4.0)。日本語の解説は、このサイトで独自に書いたものです。