メインコンテンツまでスキップ

<pc-layoutgroup>

<pc-layoutgroup>タグは、子の要素エンティティを行または列に自動的に配置するレイアウトグループコンポーネントを定義するために使用されます。

使用法
  • <pc-element> も持つ <pc-entity> の直接の子である必要があります。
  • 子エンティティは自動的に配置されます。グループ内での子のサイズ調整方法を制御するには、子に <pc-layoutchild> を追加します。

属性

属性タイプデフォルト説明
alignmentVector2"0 1"子要素の水平・垂直方向の整列(各成分0〜1)
enabledBoolean"true"コンポーネントの有効状態
height-fittingEnum"none"垂直軸方向のフィッティング: "none" | "stretch" | "shrink" | "both"
orientationEnum"horizontal"レイアウトの向き: "horizontal" | "vertical"
paddingVector4"0 0 0 0"グループ周囲のパディングを left bottom right top で指定
reverse-xFlag-水平軸に沿って子の順序を反転します
reverse-yFlag-垂直軸に沿って子の順序を反転します
spacingVector2"0 0"子同士の間隔を x y で指定
width-fittingEnum"none"水平軸方向のフィッティング: "none" | "stretch" | "shrink" | "both"
wrapFlag-子がグループからあふれたときに、新しい行または列に折り返すかどうか

<pc-entity name="list">
<pc-element type="group" width="220" height="400"></pc-element>
<pc-layoutgroup orientation="vertical" alignment="0 1" spacing="0 5" padding="10 10 10 10"></pc-layoutgroup>

<pc-entity name="item-1">
<pc-element type="image" width="200" height="45"></pc-element>
<pc-layoutchild></pc-layoutchild>
</pc-entity>
<pc-entity name="item-2">
<pc-element type="image" width="200" height="45"></pc-element>
<pc-layoutchild></pc-layoutchild>
</pc-entity>
</pc-entity>

JavaScriptインターフェース

LayoutGroupComponentElement APIを使用して、<pc-layoutgroup>要素をプログラムで作成および操作できます。