Skip to content

addCustomTexture

Downloads and loads a texture from a URL.

Syntax

lua
Ham.addCustomTexture(textureName, textureUrl)

Parameters

NameTypeDescription
textureNamestringLocal filename to cache as
textureUrlstringURL to download the texture from

Returns

  • userdata|nil - Texture handle or nil on failure

Example

lua
local logo = Ham.addCustomTexture("logo.png", "https://example.com/logo.png")
if logo then
    Ham.drawTexture(logo, {10, 10}, {60, 60}, {255, 255, 255, 255})
end

See Also

Released under the ISC License.