Flex Panel Node의 Flex Direction 설정
이 문서는 Flex Panel Node의 flexDirection
속성을 설정하는 함수에 대해 설명합니다. 이 속성은 Flexbox 레이아웃에서 요소의 방향을 결정하는 데 사용됩니다.
함수 설명
flexpanel_node_style_set_flex_direction
함수는 주어진 Flex Panel Node의 flexDirection
속성을 설정합니다. 이 속성은 다음과 같은 열거형 멤버 중 하나일 수 있습니다.
상수 | 속성 값 |
---|---|
flexpanel_flex_direction.column |
"column" |
flexpanel_flex_direction.row |
"row" |
flexpanel_flex_direction.column_reverse |
"column-reverse" |
flexpanel_flex_direction.row_reverse |
"row-reverse" |
문법
flexpanel_node_style_set_flex_direction(node, flex_direction);
인수 | 유형 | 설명 |
---|---|---|
node |
Flex Panel Node | 수정할 노드 |
flex_direction |
Flex Direction Constant | 설정할 Flex 방향 |
반환 값
- N/A
예제
다음은 노드의 Flex 방향을 "column"으로 설정하는 예제입니다.
flexpanel_node_style_set_flex_direction(_node, flexpanel_flex_direction.column);
활용 예제
- 행 방향 설정: 노드를 행 방향으로 설정하여 수평으로 정렬합니다.
gml flexpanel_node_style_set_flex_direction(_node, flexpanel_flex_direction.row);
- 열 방향 역전 설정: 노드를 열 방향으로 역전하여 아래에서 위로 정렬합니다.
gml flexpanel_node_style_set_flex_direction(_node, flexpanel_flex_direction.column_reverse);
- 행 방향 역전 설정: 노드를 행 방향으로 역전하여 오른쪽에서 왼쪽으로 정렬합니다.
gml flexpanel_node_style_set_flex_direction(_node, flexpanel_flex_direction.row_reverse);
- 동적 방향 변경: 사용자 입력에 따라 Flex 방향을 동적으로 변경합니다.
gml if (user_input == "row") { flexpanel_node_style_set_flex_direction(_node, flexpanel_flex_direction.row); } else { flexpanel_node_style_set_flex_direction(_node, flexpanel_flex_direction.column); }
- 조건부 방향 설정: 특정 조건에 따라 Flex 방향을 설정합니다.
gml if (condition) { flexpanel_node_style_set_flex_direction(_node, flexpanel_flex_direction.row_reverse); } else { flexpanel_node_style_set_flex_direction(_node, flexpanel_flex_direction.column); }