07.12.2012 Views

Adobe Director Basics

Adobe Director Basics

Adobe Director Basics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ADOBE DIRECTOR BASICS<br />

3D: Controlling action<br />

-- Lingo syntax<br />

on beginSprite<br />

-- check whether anti-aliasing is supported by the current 3D renderer<br />

if sprite(5).antiAliasingSupported = TRUE then<br />

-- if it is, turn on anti-aliasing for the sprite<br />

sprite(5).antiAliasingEnabled = TRUE<br />

end if<br />

end beginSprite<br />

// JavaScript syntax<br />

function beginSprite() {<br />

// check whether anti-aliasing is supported by the current 3D renderer<br />

if (sprite(5).antiAliasingSupported) {<br />

// if it is, turn on anti-aliasing for the sprite<br />

sprite(5).antiAliasingEnabled = true;<br />

}<br />

}<br />

Turning off anti-aliasing<br />

If you plan to animate any part of a 3D sprite, you might want to turn anti-aliasing off temporarily to improve the<br />

animation performance. To do this, set the antiAliasingEnabled property for the sprite to FALSE. Set it back to TRUE<br />

when the animation is complete.<br />

It is a good idea to turn anti-aliasing on and off on separate handlers. For example, you might want to animate a model,<br />

camera, or light while the mouse button is held down and stop the animation when the mouse button is released. In<br />

that case, you would turn off anti-aliasing in a mouseDown handler and turn it back on in a mouseUp handler, as shown<br />

in the following example:<br />

Last updated 8/26/2011<br />

393

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

Saved successfully!

Ooh no, something went wrong!