copy_surface_properties(3)

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

πŸ’… copy_surface_properties β€” an Arcan Lua API moment

okay bestie, welcome to the Arcan Lua API page for copy_surface_properties(3) β€” yes the manual name is literally right there, i folded it in for u, ur welcome 🫢


✨ NAME ✨

copy_surface_properties β€” copies the key surface properties from one VID to another. that's it. that's the whole job. no cap πŸ’–


🌸 SYNOPSIS 🌸

nil
copy_surface_properties( srcvid, dstvid )

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's what happens: this function first resolves the current surface properties of srcvid into world space, and then stores the result in dstvid. and what does "properties" mean here? it covers position, orientation, opacity and scale. the whole glow-up package, literally πŸ’…


πŸŽ€ NOTES πŸŽ€

  1. the resolved properties will NOT be translated into the local coordinate space of dstvid β€” so the results may be undesired if dstvid has its dimensions linked relative to another object than worldid. like, it's giving world-space-only energy, and if ur dstvid is living in some other object's coordinate world, that's a vibe mismatch, ngl 😭
  2. Scale is treated differently because of its relation with the initial width,height of the source. this is solved by translating the resolved dimension into a scale factor. slay, math queen 🧚
  3. the rotation transfer does not take any rotation origo offset into account. so if u had an origo situation going on, it's not coming with u. periodt.
  4. using the same object for src and for dst is prohibited. just don't. it's in MISUSE for a reason, bestie πŸ’€

🌈 EXAMPLE 🌈

here's the cute little function doing its thing:

function copy_surface_properties0()
      a = fill_surface(64, 64, 255, 0, 0);
      blend_image(a, 0.5);
      move_image(a, 100, 100);
      rotate_image(a, 300);
      resize_image(a, 128, 128);
      b = fill_surface(16, 16, 0, 255, 0);
      copy_surface_properties(a, b);
      move_image(a, 0, 0);
end

πŸ’€ MISUSE πŸ’€

absolutely do not do these. they're here so u know what NOT to do, not so u can try them πŸ™ˆ

misuse number one β€” copying onto itself, which is prohibited (see note 4):

function copy_surface_properties0()
      a = fill_surface(32, 32, 255, 0, 0);
      copy_surface_properties(a, a);
end

misuse number two β€” passing nil as the source. no bestie, nil is not a VID:

function copy_surface_properties1()
      copy_surface_properties(nil, 1);
end

⭐ SEE ALSO ⭐


k that's the whole page, mwah πŸ’œ this was the image page (that's the source/version btw), dated October 2026. now go copy some surface properties responsibly bestie, and remember: never src = dst πŸŽ€βœ¨

πŸ“¦ where this page comes from