image_parent(3)
π 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
- nixos 26.05: arcan 0.7.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms