diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-07-20 22:34:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-20 22:34:05 +0200 |
commit | 0f6028378f0fb0e026f3aeda8e4832a4931728d3 (patch) | |
tree | 59fd27d31d56741126171b35973630cdfa886dbf /doc/classes | |
parent | fa2dcc7ace5fefd7038bde2e420b2e96235a43df (diff) | |
parent | e8288ac9ab854da0efc147815cff798ac59c1504 (diff) |
Merge pull request #63127 from KoBeWi/raise_from_picture
Diffstat (limited to 'doc/classes')
-rw-r--r-- | doc/classes/ImageTexture.xml | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/doc/classes/ImageTexture.xml b/doc/classes/ImageTexture.xml index 8b85309dee..285371118c 100644 --- a/doc/classes/ImageTexture.xml +++ b/doc/classes/ImageTexture.xml @@ -42,6 +42,14 @@ Returns the format of the texture, one of [enum Image.Format]. </description> </method> + <method name="set_image"> + <return type="void" /> + <argument index="0" name="image" type="Image" /> + <description> + Replaces the texture's data with a new [Image]. This will re-allocate new memory for the texture. + If you want to update the image, but don't need to change its paramters (format, size), use [method update] instead for better performance. + </description> + </method> <method name="set_size_override"> <return type="void" /> <argument index="0" name="size" type="Vector2i" /> @@ -54,8 +62,8 @@ <argument index="0" name="image" type="Image" /> <description> Replaces the texture's data with a new [Image]. - [b]Note:[/b] The texture has to be initialized first with the [method create_from_image] method before it can be updated. The new image dimensions, format, and mipmaps configuration should match the existing texture's image configuration, otherwise it has to be re-created with the [method create_from_image] method. - Use this method over [method create_from_image] if you need to update the texture frequently, which is faster than allocating additional memory for a new texture each time. + [b]Note:[/b] The texture has to be created using [method create_from_image] or initialized first with the [method set_image] method before it can be updated. The new image dimensions, format, and mipmaps configuration should match the existing texture's image configuration. + Use this method over [method set_image] if you need to update the texture frequently, which is faster than allocating additional memory for a new texture each time. </description> </method> </methods> |