image_parent - Return a reference to the parent object.
nil
image_parent( vid:src )
image_parent( vid:src, vid:reference )
This function is used to figure out if vid is linked to another object
from a previous call to link_image and which primary attachement the
image has. This is normally WORLDID , but can be another vid through
any of the define_rendertarget class of functions. If the
reference argument is provided, the function will only return if
src is a decendent of reference . and the parentvid will
match reference .
function image_parent0()
a = fill_surface(32, 32, 255, 0, 0);
b = fill_surface(32, 32, 255, 0, 0);
c = fill_surface(32, 32, 255, 0, 0);
link_image(c, a);
image_tracetag(a, "(a)");
print(image_tracetag(image_parent(b)));
print(image_tracetag(image_parent(c)));
print(image_tracetag(image_parent(a)));
end
function image_parent1()
a = fill_surface(32, 32, 255, 0, 0)
b = fill_surface(32, 32, 255, 0, 0)
c = fill_surface(32, 32, 255, 0, 0)
d = fill_surface(32, 32, 255, 0, 0)
link_image(a, b)
link_image(b, c)
print(image_parent(a, b))
print(image_parent(a, c))
print(image_parent(a, d)) -- not a parent
end
function image_parent0()
print(image_parent(BADID));
end
function image_parent1()
print(image_parent(WORLDID));
end
image_children(3) link_image(3) valid_vid(3)