load_image_asynch(3)

πŸ“¦
version 0.7.1 Β· 2 versions
, in nixos 26.05

πŸ’… load_image_asynch(3) πŸ’…

okay bestie, welcome to the Arcan Lua API page for load_image_asynch(3) β€” the async image-loading one. We're keeping every single detail, just making it hit different. ✨

✨ NAME ✨

load_image_asynch β€” asynchronously load an image from a resource. That's the whole vibe: image loading, but not blocking your entire life, periodt.

🌸 SYNOPSIS 🌸

VID, fail:BADID
load_image_asynch( resource, callback )

It hands you back VID, fail:BADID and takes resource, callback. Slay.

πŸ¦‹ DESCRIPTION πŸ¦‹

This one sets up a brand-new video object container and attempts to load and decode an image from the specified resource. That's it. That's the whole thing. No cap. πŸ’–

πŸŽ€ NOTES πŸŽ€

  1. The new VID has its opacity set to 0, which means it will start out hidden. So don't panic if you can't see it immediately β€” it's giving stealth mode on purpose. πŸ™ˆ
  2. The operation can be forced asynchronous by either doing an operation which requires a stable state for the current context (e.g. push/pop_video_context) or by explicitly calling image_pushasynch.

πŸ”₯ EXAMPLE πŸ”₯

Here's the example, copied exactly β€” yes, exactly, bestie:

function load_image_asynch0()
      vid = load_image_asynch("test.png", function(source, tbl)
                              if (tbl.kind == "loaded") then
            resize_image(source, tbl.width, tbl.height);
            warning("image loaded0);
                              elseif (tbl.kind == "load_failed") then
            warning("couldn't load:" .. tbl.resource .. "0);
      end);
      show_image(vid);
end

πŸ’€ MISUSE πŸ’€

bestie, this section is literally called MISUSE. Don't do this:

function load_image_asynch0()
      vid = load_image_asynch("test.png", load_image_asynch);
end

πŸ’€ MISUSE πŸ’€

Yep, another one. Still don't:

function load_image_asynch1()
      vid = load_image_asynch("test.png", -1);
end

🌈 SEE ALSO: 🌈

image_pushasynchload_image(3) β€” that's the exact string the page lists. Yes, one string, no space. I'm not touching it. iykyk. πŸ’…


xoxo, this page is from image 🌸 dated October 2026 🌸 and it's load_image_asynch(3) πŸ’– stay async, bestie ✨

πŸ“¦ where this page comes from