image_parent(3)

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

πŸ’– NAME

image_parent β€” returns a reference to the parent object. periodt. 🫢

okay so you opened image_parent(3) from the Arcan Lua API, and bestie, it's giving parent-object detective energy πŸ’…


✨ SYNOPSIS

two call shapes, plus that lil nil line up top:

nil
image_parent( vid:src )
image_parent( vid:src, vid:reference )

🌸 DESCRIPTION

okay so this function is literally here to figure out two things: whether vid is linked to another object from a previous call to link_image, and which primary attachment the image has. most of the time that attachment is WORLDID, but it can also be another vid through any of the define_rendertarget class of functions. iykyk. πŸ¦‹

and if you pass the reference argument? the function will only return if src is a descendant of reference and the parentvid will match reference. that's the vibe check. βœ…


πŸŽ€ EXAMPLE

first example, bestie: three surfaces walk into a function, and link_image(c, a) happens. the prints are doing their thing:

       function image_parent0()
             a = fill_surface(32, 32, 255, 0, 0);
             b = fill_surface(32, 32, 255, 0, 0);
             c = fill_surface(32, 32, 255, 0, 0);
             link_image(c, a);
             image_tracetag(a, "(a)");
             print(image_tracetag(image_parent(b)));
             print(image_tracetag(image_parent(c)));
             print(image_tracetag(image_parent(a)));
       end

πŸŽ€ EXAMPLE

second example, and this one's lowkey a chain situation πŸ”₯ a links to b, b links to c, and then we ask about b, c, and d β€” with that iconic -- not a parent comment at the end:

       function image_parent1()
             a = fill_surface(32, 32, 255, 0, 0)
             b = fill_surface(32, 32, 255, 0, 0)
             c = fill_surface(32, 32, 255, 0, 0)
             d = fill_surface(32, 32, 255, 0, 0)
             link_image(a, b)
             link_image(b, c)
             print(image_parent(a, b))
             print(image_parent(a, c))
             print(image_parent(a, d)) -- not a parent
       end

πŸ’€ MISUSE

bestie. no. 😭 the manual files this under MISUSE, so pls don't come for me:

       function image_parent0()
             print(image_parent(BADID));
       end

πŸ’€ MISUSE

and also this one. the manual says MISUSE, so we listen:

       function image_parent1()
             print(image_parent(WORLDID));
       end

πŸ¦‹ SEE ALSO

these are the besties in the same orbit:


mwah πŸ’‹ β€” this lil page is from image, dated October 2026. go be iconic with your parent lookups. πŸ’–

πŸ“¦ where this page comes from