diff options
author | Yuri Sizov <11782833+YuriSizov@users.noreply.github.com> | 2023-02-08 22:06:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-08 22:06:26 +0300 |
commit | 2572f6800aef09bd6ea96f3b1c7a999a962eecb7 (patch) | |
tree | 2840fb68deae7984c0a280ccbc7abc528a7a321a /doc/classes/Image.xml | |
parent | ccd4caa3de9e89376f339aa76219941d1c83a482 (diff) | |
parent | 1bdc85b917aca9597f89587ba43bc71d03379f8d (diff) |
Merge pull request #72907 from akien-mga/doc-image-create
doc: Fix Image 'set_pixel' doc for use of 'create'
Diffstat (limited to 'doc/classes/Image.xml')
-rw-r--r-- | doc/classes/Image.xml | 12 |
1 files changed, 4 insertions, 8 deletions
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] |