User Guide

Chapter 362
Examples
The first line of this statement creates a texture named Rough from the cast member named
Cedar and stores it in the variable t1. The second line applies the texture as a backdrop at the
point (220, 220) within sprite 5. The texture has a rotation of 0 degrees. The last line applies the
same texture as a backdrop for camera 1 of the cast member named Scene at the point (20, 20)
with a rotation of 45 degrees.
t1 = member("Scene").newTexture("Rough", #fromCastMember, \
member("Cedar"))
sprite(5).camera.addBackdrop(t1, point(220, 220), 0)
member("Scene").camera[1].addBackdrop(t1, point(20, 20), 45)
See also
removeBackdrop
addCamera
Syntax
sprite(whichSprite).addCamera(whichCamera, index)
Description
3D command; adds the camera whichCamera, at the given index position, to the list of cameras
for the sprite. If index is greater than the value of cameraCount(), the camera is added to the
end of the list. The view from each camera is displayed on top of the view from cameras with
lower
index positions. You can set the rect property of each camera to display multiple views
within the sprite.
Example
This statement inserts the camera named FlightCam at the fifth index position of the list of
cameras of sprite 12:
sprite(12).addCamera(member("scene").camera("FlightCam"), 5)
See also
cameraCount(), deleteCamera
addChild
Syntax
member(whichCastmember).node(whichParentNode).addChild(member\
(whichCastmember).node(whichChildNode) {,#preserveWorld})
Description
3D command; adds the node whichChildNode to the list of children of the node
whichParentNode, and removes it from the list of children of its former parent. Either node
argument can be a model, group, camera, or light. An equivalent operation would be to set the
parent property of whichChildNode to whichParentNode.
The optional
#preserveWorld parameter has two possible values: #preserveWorld or
#preserveParent. When the child is added with #preserveParent specified, the parent-relative
transform of the child remains unchanged and the child jumps to that transform in the space of its
new parent. The child’s world transform is recalculated. When the child is added with
#preserveWorld specified, the world transform of the child remains unchanged and the child does
not jump to its transform in the space of its new parent. Its parent-relative transform is recalculated.