User Guide
320 Chapter 15: The 3D Cast Member, 3D Text, and 3D Behaviors
Textures
Textures are 2D images that are drawn on the surface of a 3D model. Textures can be assigned to
models in your 3D modeling software, or you can use any bitmap cast member in your movie.
You can also use any image object created using Lingo or JavaScript.
The following cast member methods and properties can be used to perform basic
texture operations:
deleteShader
(name)
Deletes the shader named name. Script
references to this shader persist but can
do nothing.
TRUE (1) if the shader named
name exists. FALSE (0) if the
shader named
name doesn’t
exist.
deleteShader
(index)
Deletes the shader with the given index
number. Script references to this shader
persist but can do nothing.
TRUE (1) if the shader with this
index number exists.
FALSE
(0)
if the shader with this index
number doesn’t exist.
Method Function Returns
texture.count
Returns the number of textures in the texture
object list of the cast member.
Integer.
texture(name)
Returns the texture object named name. Returns the texture object
named
name if it exists. Returns
void if the object does not
exist.
texture[index]
Returns the texture at the designated
position in the index. The index number can
change if textures are added or deleted.
Returns the texture object at
that index number if it exists.
Returns
void if the object does
not exist at that index number.
newTexture
(name, type,
source)
Creates a new texture named name.
The
type can have the following values:
#fromCastmember
#fromImageObject
If
type is #from Castmember, source is a cast
member reference. For example,
member("concrete") or member[2,3]
If type is #from ImageObject, source is a
script image object.
Returns a new texture object
with a unique name. If the
name isn’t unique, returns a
script error.
deleteTexture
(name)
Deletes the texture named name. Script
references to this texture persist but can
do nothing.
TRUE (1) if the texture named
name exists. FALSE (0) if the
texture named
name doesn’t
exist.
deleteTexture
(index)
Deletes the texture with the given index
number. Script references to this texture
persist but can do nothing.
TRUE (1) if the texture with this
index number exists.
FALSE
(0)
if the texture with this
index number doesn’t exist.
Method Function Returns