@@ -99,6 +99,18 @@ void MovieWriter::begin(const Size2i &p_movie_size, uint32_t p_fps, const String
99
99
100
100
print_line (vformat (" Movie Maker mode enabled, recording movie at %d FPS..." , p_fps));
101
101
102
+ // When using Display/Window/Stretch/Mode = Viewport, use the project's
103
+ // configured viewport size instead of the size of the window in the OS
104
+ Size2i actual_movie_size = p_movie_size;
105
+ String stretch_mode = GLOBAL_GET (" display/window/stretch/mode" );
106
+ if (stretch_mode == " viewport" ) {
107
+ actual_movie_size.width = GLOBAL_GET (" display/window/size/viewport_width" );
108
+ actual_movie_size.height = GLOBAL_GET (" display/window/size/viewport_height" );
109
+
110
+ print_line (vformat (" Movie Maker mode using project viewport size: %dx%d" ,
111
+ actual_movie_size.width , actual_movie_size.height ));
112
+ }
113
+
102
114
// Check for available disk space and warn the user if needed.
103
115
Ref<DirAccess> dir = DirAccess::create (DirAccess::ACCESS_FILESYSTEM);
104
116
String path = p_base_path.get_basename ();
@@ -125,7 +137,7 @@ void MovieWriter::begin(const Size2i &p_movie_size, uint32_t p_fps, const String
125
137
audio_channels = AudioDriverDummy::get_dummy_singleton ()->get_channels ();
126
138
audio_mix_buffer.resize (mix_rate * audio_channels / fps);
127
139
128
- write_begin (p_movie_size , p_fps, p_base_path);
140
+ write_begin (actual_movie_size , p_fps, p_base_path);
129
141
}
130
142
131
143
void MovieWriter::_bind_methods () {
0 commit comments