copy_surface_properties - Copy key surface properties from one VID to
another.
nil
copy_surface_properties( srcvid, dstvid )
This function will first resolve the current surface properties of srcvid
into world space and then store the result in dstvid . This covers
position, orientation, opacity and scale.
- 1
- The resolved properties will not be translated into the local coordinate
space of dstvid , thus the results may be undesired if
dstvid has its dimensions linked relative to another object than
worldid.
- 2
- Scale is treated differently due to its relation with the initial
width,height of the source. This is solved by translating the resolved
dimension into a scale factor.
- 3
- The rotation transfer does not take any rotation origo offset into
account.
- 4
- Using the same object for src and for dst is prohibited.
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
function copy_surface_properties0()
a = fill_surface(32, 32, 255, 0, 0);
copy_surface_properties(a, a);
end
function copy_surface_properties1()
copy_surface_properties(nil, 1);
end