draw_surface_stretched_ext 함수 설명
draw_surface_stretched_ext
함수는 draw_surface_stretched
함수와 동일하게 작동하지만, 그리기 시 서피스의 색상 혼합 및 알파 값을 설정할 수 있는 추가 기능이 있습니다. 이는 draw_surface_ext
함수와 유사합니다.
문법
draw_surface_stretched_ext(surface, x, y, w, h, col, alpha);
인수 설명
인수 | 타입 | 설명 |
---|---|---|
surface | Surface | 그릴 서피스 |
x | Real | 서피스를 그릴 x 위치 |
y | Real | 서피스를 그릴 y 위치 |
w | Real | 서피스를 그릴 너비 |
h | Real | 서피스를 그릴 높이 |
col | Colour | 서피스를 색칠할 색상 |
alpha | Real | 서피스를 혼합할 알파 값 |
반환값
- N/A
예제
draw_surface_stretched_ext(surf, x, y, 200, 200, c_white, 0.5);
위 코드는 주어진 서피스를 인스턴스의 (x, y) 위치에 왼쪽 모서리를 두고 200x200 픽셀 영역으로 늘려서 그립니다. 색상 혼합은 없지만 부분적으로 투명하게 그려집니다.
활용 예제
- 배경 이미지 그리기
draw_surface_stretched_ext(background_surface, 0, 0, room_width, room_height, c_white, 1);
- UI 요소에 반투명 효과 주기
draw_surface_stretched_ext(ui_surface, 50, 50, 300, 150, c_black, 0.7);
- 게임 오버 화면 표시하기
draw_surface_stretched_ext(game_over_surface, 0, 0, room_width, room_height, c_red, 0.5);
- 캐릭터의 그림자 효과 추가하기
draw_surface_stretched_ext(shadow_surface, character_x, character_y + 10, character_width, character_height, c_black, 0.3);
- 특정 이벤트 발생 시 효과 표시하기
draw_surface_stretched_ext(effect_surface, event_x, event_y, 100, 100, c_yellow, 0.8);