mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Rename StreamTexture* to CompressedTexture*
* Its not and will not be used for streaming. * Streaming will be implemented in 4.1 and it will work different. * It makes more sense to be called CompressedTexture since it imports and compresses texture files.
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
var texture = load("res://icon.png")
|
||||
$Sprite2D.texture = texture
|
||||
[/codeblock]
|
||||
This is because images have to be imported as a [StreamTexture2D] first to be loaded with [method @GDScript.load]. If you'd still like to load an image file just like any other [Resource], import it as an [Image] resource instead, and then load it normally using the [method @GDScript.load] method.
|
||||
This is because images have to be imported as a [CompressedTexture2D] first to be loaded with [method @GDScript.load]. If you'd still like to load an image file just like any other [Resource], import it as an [Image] resource instead, and then load it normally using the [method @GDScript.load] method.
|
||||
[b]Note:[/b] The image can be retrieved from an imported texture using the [method Texture2D.get_image] method, which returns a copy of the image:
|
||||
[codeblock]
|
||||
var texture = load("res://icon.png")
|
||||
|
||||
Reference in New Issue
Block a user