Loading is asynchronous.
width and height are 0 until ready is true, and render.image draws nothing before that.Loading
constructor
path is relative to the script folder. A missing file throws Error with code ENOENT.
Keep the images your script ships with in
assets/. That folder is published and delivered to
buyers with the script; data/ and other folders stay on your disk. See
Folder layout.width and height only apply to SVG and set its raster size.
fromMemory
data is copied, so you can reuse it.
update
fromMemory. This is how you animate
one: draw a graph or a visualizer into a buffer and update one texture every frame. Making a new
texture every frame is slow, and every one of them sits in GPU memory until it’s collected.
ready (ENOTREADY before that).
Properties
toString() gives something like Texture(64x64, ready, "C:/…/logo.svg").