diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-08 18:46:00 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-08 19:02:19 +0100 |
commit | 1bdc85b917aca9597f89587ba43bc71d03379f8d (patch) | |
tree | 9e13958b2a79dfe85daa47d60dda9b36ea5ad7a3 | |
parent | c4fb119f03477ad9a494ba6cdad211b35a8efcce (diff) | |
download | redot-engine-1bdc85b917aca9597f89587ba43bc71d03379f8d.tar.gz |
doc: Fix Image 'set_pixel' doc for use of 'create'
Fixes #72904.
-rw-r--r-- | doc/classes/HTTPRequest.xml | 3 | ||||
-rw-r--r-- | doc/classes/Image.xml | 12 |
2 files changed, 5 insertions, 10 deletions
diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index 5a0b12e198..1905fcd8bb 100644 --- a/doc/classes/HTTPRequest.xml +++ b/doc/classes/HTTPRequest.xml @@ -141,8 +141,7 @@ GD.PushError("Couldn't load the image."); } - var texture = new ImageTexture(); - texture.CreateFromImage(image); + var texture = ImageTexture.CreateFromImage(image); // Display the image in a TextureRect node. var textureRect = new TextureRect(); diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index 5b07124b91..166ef7a108 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -482,16 +482,14 @@ [gdscript] var img_width = 10 var img_height = 5 - var img = Image.new() - img.create(img_width, img_height, false, Image.FORMAT_RGBA8) + var img = Image.create(img_width, img_height, false, Image.FORMAT_RGBA8) img.set_pixel(1, 2, Color.RED) # Sets the color at (1, 2) to red. [/gdscript] [csharp] int imgWidth = 10; int imgHeight = 5; - var img = new Image(); - img.Create(imgWidth, imgHeight, false, Image.Format.Rgba8); + var img = Image.Create(imgWidth, imgHeight, false, Image.Format.Rgba8); img.SetPixel(1, 2, Colors.Red); // Sets the color at (1, 2) to red. [/csharp] @@ -510,16 +508,14 @@ [gdscript] var img_width = 10 var img_height = 5 - var img = Image.new() - img.create(img_width, img_height, false, Image.FORMAT_RGBA8) + var img = Image.create(img_width, img_height, false, Image.FORMAT_RGBA8) img.set_pixelv(Vector2i(1, 2), Color.RED) # Sets the color at (1, 2) to red. [/gdscript] [csharp] int imgWidth = 10; int imgHeight = 5; - var img = new Image(); - img.Create(imgWidth, imgHeight, false, Image.Format.Rgba8); + var img = Image.Create(imgWidth, imgHeight, false, Image.Format.Rgba8); img.SetPixelv(new Vector2I(1, 2), Colors.Red); // Sets the color at (1, 2) to red. [/csharp] |