2
0
Эх сурвалжийг харах

Document that ViewportTexture is flipped on Y

Fixes #26141.
Rémi Verschelde 6 жил өмнө
parent
commit
8b9ec8bc88

+ 5 - 1
doc/classes/Viewport.xml

@@ -80,7 +80,11 @@
 			<return type="ViewportTexture">
 			</return>
 			<description>
-				Returns the viewport's texture.
+				Returns the viewport's texture. Note that due to the way OpenGL works, the resulting [ViewportTexture] is flipped vertically. You can use [method Image.flip_y] on the result of [method Texture.get_data] to flip it back, for example:
+				[codeblock]
+				var img = get_viewport().get_texture().get_data()
+				img.flip_y()
+				[/codeblock]
 			</description>
 		</method>
 		<method name="get_viewport_rid" qualifiers="const">