07.12.2012 Views

Adobe Director Basics

Adobe Director Basics

Adobe Director Basics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ADOBE DIRECTOR BASICS<br />

3D: Controlling appearance<br />

2 In the Message window, execute the following command:<br />

new(#script).scriptText = Particle_GetScriptText(member("3D"), "Particle Test")<br />

This will create a new Movie Script member in your movie.<br />

3 Stop the movie and restart it. All the changes that you made to the Particle system will be lost.<br />

4 In the Message window, execute the commands below:<br />

vList = Particle_GetPropertyList() -- in your new<br />

scriptParticle_SetProperties(member("3D"),"Particle Test",vList)<br />

Initially, the new script will be created as a Movie Script. If you call Particle_GetPropertyList(), only the first movie<br />

script with that handler will respond. If you want to create a number of different Particle systems, you can give the<br />

scripts different names. The following are some commands to test in the Message window.<br />

v3DMember = member("3D")<br />

vName = "Explosion"<br />

vPropList = script(vName).Particle_GetPropertyList()<br />

vResource = Particle_SetProperties(v3DMember, vName, vPropList)<br />

vModel = v3DMember.newModel(vName, vResource)<br />

Using textured particles<br />

These commands create a new particle modelResource, and a new model, using the data stored in the Explosion<br />

script.<br />

In the Snow example in the Particles.dir movie, the snowflakes display a texture. Each particle is in fact a square plane.<br />

If you set the texture property of a #particle modelResource, that texture will be applied to the square plane. You can<br />

use a 32-bit image with transparency in the alpha to hide parts of the square. Since the snowflakes are round, a square<br />

texture mapped to a square plane works perfectly.<br />

You can change the texture of a #particle modelResource on the fly. Immediately, all the particles will change their<br />

texture. To see this in action, show the Snow particles in the Particles.dir movie, then click on the 3D sprite. You will<br />

see the snowflakes spin. To see another example of textured particles, download and launch the movie Balloons.dir.<br />

The balloon particles do not appear to be square, because of the alpha-channel transparency in the texture.<br />

In this movie, too, the texture is mapped to a square plane. However, only a narrow part of the texture is opaque, so<br />

the balloon particles appear to be tall and thin. See “Images for textures” on page 144 for more details.<br />

Last updated 8/26/2011<br />

199

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!