Remote Image is a lightweight Godot plugin that makes it easy to load images from a URL at runtime. It includes an in-memory cache so repeated requests for the same URL are served instantly without another download.
- Simple API for downloading images from URLs
- Runtime in-memory caching
- Supports: PNG, JPEG, SVG, WebP, BMP
- Copy the addons/remote_image folder into your project.
- Enable the plugin in Project Settings → Plugins.
- Enable the plugin after installing the asset.
- This will automatically add an autoload called RemoteImageCache and also give you access to the RemoteImageRequest node.
const url = "https://godotengine.org/assets/press/logo_large_color_light.png"
var req = RemoteImageRequest.new(url, true)
req.received.connect(_on_image_received)
req.failed.connect(_on_image_failed)
add_child(req)
req.download()
func _on_image_received(image: ImageTexture, url: String, from_cache: bool) -> void:
if image:
print("Received image from: ", url)
print("From cache: ", from_cache)
$MarginContainer/TextureRect.texture = image
else:
print("At this point, this should never happen...")
func _on_image_failed(url: String, error: String) -> void:
print("Image load failed for: ", url, error)received(image: ImageTexture, url: String, from_cache: bool)– emitted when the image is downloaded and decodedfailed(url: String, error: String)– emitted when the download or decode fails
- Cache is in-memory and lasts for the lifetime of the running game.
- If the same URL is requested again, the cached image is returned immediately.
- Maybe add persistant caching?
See LICENSE.