Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix example in NoiseTexture doc #54671

Merged
merged 1 commit into from
Nov 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions modules/opensimplex/doc_classes/NoiseTexture.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
NoiseTexture can also generate normal map textures.
The class uses [Thread]s to generate the texture data internally, so [method Texture2D.get_image] may return [code]null[/code] if the generation process has not completed yet. In that case, you need to wait for the texture to be generated before accessing the image and the generated byte data:
[codeblock]
var texture = preload("res://noise.tres")
yield(texture, "changed")
var texture = NoiseTexture.new()
texture.noise = OpenSimplexNoise.new()
await texture.changed
var image = texture.get_image()
var data = image.get_data()
[/codeblock]
Expand Down