-
-
Notifications
You must be signed in to change notification settings - Fork 1
Downloads
Manolo Cantón edited this page Aug 23, 2024
·
1 revision
HTTPManagerDownload
is a class to request a file. You can create from a url
using HTTPManagerDownload.create_from_url()
and adds the download to the queue using HTTPManagerDownload.start()
.
HTTPManagerDownload.create_from_url("http://www.example.com/images/01.png").start(_on_download_completed)
func _on_download_completed(response: HTTPManagerResponse) -> void:
if response.successful:
var image = response.parse()
if image:
# Uses your image as texture using ImageTexture.create_from_image(image)
else:
push_error("It is not image.")
else:
push_error("Response Error.")
It has similar methods to HTTPManagerRequest
. I would like to combine properties and methods of both classes into one base class, but for now they work fine as is.
Note: Cache system is pending.