From 8b9ec8bc8820c0756544ecce45d8e867b7aad17b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 22 Feb 2019 15:11:32 +0100 Subject: [PATCH] Document that ViewportTexture is flipped on Y Fixes #26141. --- doc/classes/Viewport.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 880dc43c900..09891ca889a 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -80,7 +80,11 @@ - 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]