relink_image(3)
β¨ relink_image β the Arcan Lua API one β¨
okay so bestie, we're talking about relink_image from the Arcan Lua API. it's the glow-up sibling of link_image, and it does exactly what it says on the tin: reassigns and translates the property-space so it's relative to another object. no cap. π
π« SYNOPSIS
nil
relink_image( vid:id, vid:newparent )
relink_image( vid:id, vid:newparent, int:panchor )
relink_image( vid:id, vid:newparent, int:panchor, int:anchor_opt )
four ways to call it, zero returns (it gives you nil, queen of not making a scene) π«Ά
πΈ DESCRIPTION
so this one is a specialized variant of link_image β pls go read that function's docs first if you want the full breakdown of the arguments, because relink_image reuses them all, fr fr. π
the ONE thing that makes it different? it preserves the relative resolved world-space position between id and newparent. literally the whole personality. π
here's the vibe check, side by side:
- with
link_image, ifidis at100,100andnewparentis at100,100, the post-link world coordinate ofidwill be200,200. yeah. it stacked them. π - with
relink_image, the post-link world coordinate will be100,100, and its local properties will put it at0,0. slay. β¨
so it's roughly equivalent to resolving id and newparent before linking, calculating the relative position difference, and moving the object to that new position. same energy, way less code on your end. π
ngl this is the one you want when you're reparenting something and you don't want it to teleport across the screen like it got caught in a glitch. π₯
π¦ EXAMPLE
function relink_image0()
a = fill_surface(64, 64, 255, 0, 0);
b = fill_surface(32, 32, 0, 255, 0);
move_image(a, 100, 100)
move_image(b, 110, 110)
relink_image(b, a);
show_image(b);
blend_image(a, 1.0, 50);
move_image(a, VRESW, VRESH, 100);
rotate_image(a, 100, 100);
expire_image(a, 100);
end
two surfaces, a 64Γ64 red one and a 32Γ32 green one, both moved off to their little corners, and then relink_image(b, a) snaps b under a without yeeting it. iconic behaviour. then it does the whole show: show_image(b), blend_image(a, 1.0, 50), move_image(a, VRESW, VRESH, 100), rotate_image(a, 100, 100), and finally expire_image(a, 100). main character energy from start to finish. πβ
mwah π this page came to you from the image section, snapped in October 2026, and it's forever filed under relink_image(3) β go forth and reparent responsibly, bestie π§ββοΈ
π¦ 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