|
Adding the texture
Once the shader has been added, click the line of text that says "Add Texture" to run the Create Texture script. That script contains the following Lingo:
on mouseUp(me)
if voidP(sprite(1).member.shader("newTexture")) then
tSprite = sprite(1)
tMember = tSprite.member
tTexture = tMember.newTexture("newTexture", \
#fromCastMember, member("Colors"))
tMember.model("newSphere").shader.texture = tTexture
tMember.model("newSphere").shader.textureMode = #none
go next
end if
end
Here is what the script does:
 |
It makes sure the texture hasn't already been added to the model. |
 |
If the model does not have the texture, the script creates a new texture from the previously created bitmap cast member named Colors. |
 |
The script then applies the texture to the model's shader, so it appears on the surface of the model. |
 |
The textureMode property of the shader is set to #none so that the texture is applied with no special settings. |
|