center_image(3)
π NAME π
hey bestie, welcome to center_image(3) from the Arcan Lua API β it moves a video object relative to an external reference object. Itβs giving βalign my video bestie against an outside anchorβ energy, and honestly? iconic. π
β¨ SYNOPSIS β¨
okay so the call shapes are exactly these, and yes the first line is literally nil:
nil
center_image( vid:src, vid:ref )
center_image( vid:src, vid:ref, int:anchor )
center_image( vid:src, vid:ref, int:anchor, int x_ofs )
center_image( vid:src, vid:ref, int:anchor, int x_ofs, y_ofs )
π DESCRIPTION π
This positions the center of src relative to the center anchor point on ref. π«Ά
The anchor point can be changed by specifying the anchor object to one of these, bestie:
ANCHOR_ULβ upper-leftANCHOR_CRβ upper-centerANCHOR_URβ upper-rightANCHOR_CLβ center-leftANCHOR_Cβ centerANCHOR_CRβ center-rightANCHOR_LLβ lower-leftANCHOR - LCβ lower-centerANCHOR_LRβ lower-right
yep, ANCHOR_CR really shows up twice in the source list with two different labels β keeping it exactly as-is, no cap π
The final position can also be shifted by specifying x_ofs (px) and y_ofs. β¨
This is a one-time alignment and resolves src and ref into world-space when calculating the final coordinates. For automatic response to changes in ref, use the link_image function. π¦
πΈ EXAMPLE πΈ
hereβs the example, verbatim, because I would never mess with code:
function center_image0()
local a = fill_surface(64, 32, 255, 0, 0);
local b = fill_surface(127, 127, 0, 255, 0);
show_image({a, b});
center_image(a, b);
end
π¦ SEE ALSO π¦
mwah π β this pageβs source/version is image, and itβs dated October 2026; catch you in the next manpage, 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