Flex Panel Node 최대 높이 가져오기

이 문서는 Flex Panel Node의 최대 높이를 가져오는 함수인 flexpanel_node_style_get_max_height에 대해 설명합니다. 이 함수는 주어진 Flex Panel Node의 maxHeight 속성을 반환합니다.

함수 문법

flexpanel_node_style_get_max_height(node);

매개변수 설명

매개변수 타입 설명
node Flex Panel Node 읽어올 노드

반환값

  • Flex Panel Unit-Value Struct: 주어진 노드의 최대 높이 값

예제

아래의 예제는 노드의 최대 높이를 가져와서 로컬 변수에 저장하는 방법을 보여줍니다.

var _max_height = flexpanel_node_style_get_max_height(_node);

이 코드는 _node의 최대 높이를 가져와 _max_height라는 변수에 저장합니다.

활용 예제

  1. 최대 높이 설정 후 확인하기 gml flexpanel_node_style_set_max_height(_node, 300); var _max_height = flexpanel_node_style_get_max_height(_node); show_message("최대 높이는: " + string(_max_height));
  2. 조건에 따라 최대 높이 조정하기 gml var _current_height = flexpanel_node_style_get_max_height(_node); if (_current_height < 200) { flexpanel_node_style_set_max_height(_node, 200); }
  3. 여러 노드의 최대 높이 비교하기 gml var _max_height1 = flexpanel_node_style_get_max_height(_node1); var _max_height2 = flexpanel_node_style_get_max_height(_node2); if (_max_height1 > _max_height2) { show_message("노드 1의 최대 높이가 더 큽니다."); } else { show_message("노드 2의 최대 높이가 더 큽니다."); }
  4. UI 요소의 동적 크기 조정하기 gml var _max_height = flexpanel_node_style_get_max_height(_node); if (_max_height > 500) { flexpanel_node_style_set_max_height(_node, 500); }
  5. 게임 오브젝트의 높이에 따라 UI 조정하기 gml var _player_height = player.sprite_height; flexpanel_node_style_set_max_height(_node, _player_height + 50);

이와 같은 예제들은 flexpanel_node_style_get_max_height 함수를 활용하여 다양한 상황에서 최대 높이를 조정하고 활용하는 방법을 보여줍니다.