image_origo_offset(3)
π image_origo_offset(3) β the Arcan Lua API one
Okay so bestie, welcome to image_origo_offset, from the Arcan Lua API, section 3 of the manual. This is the little function that lets you nudge where an object thinks its center of rotation is, and where it anchors itself. It's giving "I'm the main character and my pivot point is wherever I say it is" energy. β¨
πΈ NAME πΈ
image_origo_offset β shift the current object rotation and anchoring offset π«
π SYNOPSIS π
nil
image_origo_offset( vid:dst, number:xofs, number:yofs )
image_origo_offset( vid:dst, number:xofs, number:yofs, number:zofs=0.0 )
image_origo_offset( vid:dst, number:xofs, number:yofs, number:zofs=0.0 )
image_origo_offset( vid:dst, number:xofs, number:yofs, number:zofs=0.0,
int:anchor )
Yeah, it returns nil. No takebacks, no value, just vibes and a shifted origo. π«Ά
π¦ DESCRIPTION π¦
So like, by default every object's rotation origo is set to its local center β that's (0.5*w, 0.5*h), literally the middle of the thing. This function is your little handle for adding an offset value on top of that. That's it, that's the whole bit. π
Now for anchoring, the valid anchor values are, and I quote the whole squad:
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
Yeah bestie, ANCHOR_CR shows up twice in that list (upper-center and center-right). That's literally what the page says, so I'm not out here editing the source material. π Note it and move on.
β NOTES β
- Rotation offset is relative to the local object itself. For complex object hierarchies, the bounding volume would have to be calculated and each object shifted in turn. No cap, that's just how it is β you don't get free nested shifting, you gotta do the math per object. π
π₯ EXAMPLE π₯
function image_origo_offset0()
a = fill_surface(32, 32, 255, 0, 0);
b = fill_surface(32, 32, 0, 255, 0);
show_image({a, b});
move_image(a, 50, 100);
move_image(b, 100, 100);
rotate_image(a, 45);
rotate_image(b, 45);
image_origo_offset(b, -10, -10);
end
Two squares, both spun 45Β°, but only b gets its origo yanked by -10, -10. Watch them rotate around completely different points. Iconic. π
π EXAMPLE π
function image_origo_offset1()
a = fill_surface(128, 128, 255, 0, 0)
b = fill_surface(32, 32, 0, 255, 0);
show_image({a, b})
link_image(a, b, ANCHOR_LR)
image_origo_offset(a, 0, 0, 0, ANCHOR_C)
end
Here we link a to b at ANCHOR_LR, then set a's anchor to ANCHOR_C β zero offset on all axes, just a straight anchor switch. Slay. π
π SEE YA π
That's the whole page, bestie β originally from image, dated October 2026, living at image_origo_offset(3). Go forth and pivot correctly. π§ββοΈπ
π¦ 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