Resource API Docs

Textures Resource API

Resource API Index

Purpose

Texture helpers load, reserve, and drop texture sources while returning stable TextureID handles.

Textures Resource API explains behavior, constraints, and practical usage so implementation decisions stay consistent across scripts and scenes.

API Source

Functions

texture_load!texture_reserve!texture_drop!

Enums

// not documented yet for this module

Constants

repeated source -> stable TextureID

Types

ResourceWindowTextureIDScriptContext

Usage Pattern

let tex = texture_load!(res, "res://player.png");let icon = texture_reserve!(res, "res://ui/icon.png");let _ = texture_drop!(res, "res://old.png");

Key Details

Repeated load/reserve for the same source returns the same TextureID.

GPU creation is async relative to script calls.

reserve prevents automatic cache eviction.

drop operates by source path, not id.