Texture Group 상태 확인 함수
이 문서는 Dynamic Texture Group의 상태를 확인하는 texturegroup_get_status
함수에 대해 설명합니다. 이 함수는 주어진 Texture Group의 상태를 반환하며, 상태는 다음과 같은 상수 중 하나입니다.
상태 상수 | 설명 | 값 |
---|---|---|
texturegroup_status_unloaded | Texture Group가 디스크에 있지만 메모리에 없음 | 0 |
texturegroup_status_loading | Texture Group가 현재 디스크에서 로드 중임 | 1 |
texturegroup_status_loaded | Texture Group가 RAM에 로드됨 | 2 |
texturegroup_status_fetched | Texture Group가 VRAM에 로드되어 사용 준비 완료 | 3 |
사용법
함수의 문법은 다음과 같습니다:
texturegroup_get_status(groupname);
인수 설명
인수 이름 | 유형 | 설명 |
---|---|---|
groupname | String | Texture Group의 이름을 문자열로 입력합니다. 이 이름은 Texture Groups 창에서 정의됩니다. |
반환값
이 함수는 Texture Group의 상태 상수를 반환합니다.
예제
다음은 texturegroup_get_status
함수를 사용하는 예제입니다:
var _tg = "tg_UI";
var _status = texturegroup_get_status(_tg);
if (_status == texturegroup_status_unloaded) {
texturegroup_load(_tg);
}
위 코드는 "tg_UI" Texture Group의 상태를 확인하고, 만약 상태가 언로드(unloaded) 상태라면 해당 Texture Group을 로드합니다.
활용 예제
- Texture Group 상태 확인 후 로드하기
gml var _tg = "tg_Background"; var _status = texturegroup_get_status(_tg); if (_status == texturegroup_status_unloaded) { texturegroup_load(_tg); }
- Texture Group이 로드되었는지 확인하고 사용하기
gml var _tg = "tg_Characters"; var _status = texturegroup_get_status(_tg); if (_status == texturegroup_status_loaded) { // 텍스처를 사용하여 캐릭터 그리기 }
- Texture Group이 VRAM에 있는지 확인하기
gml var _tg = "tg_Enemies"; var _status = texturegroup_get_status(_tg); if (_status == texturegroup_status_fetched) { // VRAM에서 텍스처를 사용하여 적 그리기 }
이와 같이 texturegroup_get_status
함수를 활용하여 Texture Group의 상태를 확인하고 적절한 조치를 취할 수 있습니다.