Flex Panel Node 스타일 가져오기
이 문서는 flexpanel_node_style_get_flex_direction
함수에 대해 설명합니다. 이 함수는 주어진 Flex Panel Node의 flexDirection
속성을 반환합니다.
함수 설명
- 함수 이름:
flexpanel_node_style_get_flex_direction
- 구문:
flexpanel_node_style_get_flex_direction(node);
매개변수
매개변수 | 유형 | 설명 |
---|---|---|
node | Flex Panel Node | 읽어올 노드 |
반환값
- 유형: Flex Direction Constant
- 설명: 주어진 노드의 Flex Direction을 반환합니다.
예제
다음 코드는 노드의 Flex Direction을 가져와서 로컬 변수에 저장하는 예제입니다.
var _flex_direction = flexpanel_node_style_get_flex_direction(_node);
활용 예제
- Flex Direction 확인하기
gml var direction = flexpanel_node_style_get_flex_direction(myNode); if (direction == FLEX_DIRECTION_ROW) { // 행 방향일 때의 처리 }
- 조건에 따른 스타일 변경
gml var direction = flexpanel_node_style_get_flex_direction(myNode); if (direction == FLEX_DIRECTION_COLUMN) { flexpanel_node_style_set_flex_direction(myNode, FLEX_DIRECTION_ROW); }
- 다양한 노드에 대해 Flex Direction 가져오기
gml for (var i = 0; i < nodeCount; i++) { var direction = flexpanel_node_style_get_flex_direction(nodes[i]); // 각 노드의 방향에 따른 처리 }
- UI 레이아웃 조정
gml var direction = flexpanel_node_style_get_flex_direction(myNode); if (direction == FLEX_DIRECTION_ROW) { // UI 요소를 수평으로 정렬 } else { // UI 요소를 수직으로 정렬 }
이 문서에서는 flexpanel_node_style_get_flex_direction
함수의 사용법과 다양한 활용 예제를 제공하였습니다.