Changing Sprite Properties

   

Each sprite includes a set of properties that describes how the sprite looks in your Director movie. These properties include a sprite's Stage-location coordinates, size , blend percentage, ink effect, start frame and end frame, rotation, and skew angles, as well as animation options. You can vary these properties frame by frame as part of the animation process. (See Chapter 4, "Animating Sprites .")

You can change some sprite propertiessuch as size and Stage coordinatesby moving or resizing a sprite on the Stage. You can also change these properties, and others as well, by using the Property Inspector's Sprite tab or the Sprite toolbar in the Score. The Sprite toolbar contains the same set of properties as the Property Inspector; which one you use is a matter of preference.

While working on the Stage, you can view a set of commonly used sprite properties (coordinates, ink effect, and blend percentage) directly on the Stage in a small box called the sprite overlay. Using this overlay is often more convenient than having to go back and forth between the Stage and Property Inspector.

To open the Property Inspector for a sprite:

  1. Select a sprite in the Score or on the Stage.

  2. Choose Modify > Sprite > Properties.

    The Property Inspector opens, with the Sprite tab displayed ( Figure 3.44 ).

    Figure 3.44. The Property Inspector's Sprite tab.

    graphics/03fig44.gif

To toggle the display of the Sprite toolbar:

  1. Choose View > Sprite Toolbar ( Figure 3.45 ).

    Figure 3.45. Set sprite properties in the Score's Sprite toolbar.

    graphics/03fig45.gif

  2. Select a sprite to view its properties in the Sprite toolbar.

To view sprite properties on the Stage:

  1. Choose View > Sprite Overlay > Show Info .

    Sprite properties are displayed in a rectangle below each sprite ( Figure 3.46 ).

    Figure 3.46. Turn on the Show Info option to view sprite details in a small rectangle below a sprite.

    graphics/03fig46.gif

  2. Choose View > Sprite Overlay > Settings to open the Overlay Settings dialog box.

  3. Choose an overlay setting to define how Director displays the sprite information ( Figure 3.47 ):

    Figure 3.47. In the Overlay Settings dialog box, specify how Director displays the sprite information.

    graphics/03fig47.gif

    Click Roll Over if you want sprite properties to be displayed when you roll the mouse pointer over a sprite on the Stage.

    Click Selection if you want properties to be displayed only for selected sprites.

    Click All Sprites if you want properties to be displayed for all sprites on the Stage.

graphics/tick.gif Tip

  • Click the small center icon ( Figure 3.48 ) on the left side of a Sprite Overlay panel to edit the sprite properties in the Property Inspector. Click the top icon to edit the cast member properties. Click the bottom icon to edit the behavior of the given sprite.

    Figure 3.48. Click the small center icon in the panel below the sprite to edit the sprite's properties.

    graphics/03fig48.gif


To resize a sprite:

  1. In the Score or on the Stage, select a sprite.

    A rectangular outline with square resizing handles surrounds the sprite on the Stage ( Figure 3.49 ).

    Figure 3.49. A selected sprite on the Stage has eight small resize handles.

    graphics/03fig49.gif

  2. On the Stage, drag one of the sprite's handles to stretch or squeeze the sprite ( Figure 3.50 ).

    Figure 3.50. Drag resize handles to stretch or squeeze a sprite.

    graphics/03fig50.gif

    Hold the Shift key while dragging a corner handle of the sprite to resize it proportionately.

graphics/tick.gif Tips

  • Resizing a sprite affects only the selected sprite; the original cast member remains unchanged.

  • You can resize multiple sprites at the same time by selecting them together in the Score and then resizing one of the selected sprites on the Stage. All the selected sprites resize in the same way.

  • You can also resize a sprite by using the Scale Sprite dialog box ( Figure 3.51 ). With a sprite selected, click the Scale button on the Sprite tab of the Property Inspector to open the dialog box. Enter an overall scale percentage or individual values for the width and height. You can check the Maintain Proportions option if you want to maintain the sprite's original width-to-height ratio.

    Figure 3.51. Resize a sprite by entering width and height dimensions in the Scale Sprite dialog box.

    graphics/03fig51.gif


To rotate a sprite:

  1. Select a sprite in the Score or on the Stage.

    A rectangular outline surrounds the selected sprite on the Stage ( Figure 3.52 ).

    Figure 3.52. Select a sprite to rotate.

    graphics/03fig52.gif

  2. Choose Modify > Sprite > Properties to display the Property Inspector.

  3. In the Property Inspector, type a number of degrees in the Rotation field and press Enter ( Figure 3.53 ).

    Figure 3.53. In the Property Inspector, type how many degrees to rotate the sprite.

    graphics/03fig53.gif

    A positive number rotates the sprite clockwise ( Figure 3.54 ); a negative number rotates it counterclockwise.

    Figure 3.54. The sprite, rotated 45 degrees clockwise.

    graphics/03fig54.gif

graphics/tick.gif Tips

  • You can also rotate sprites with the Rotation and Skew tool in the Tool palette. First, choose Window > Tool Palette, and click the Rotation and Skew tool ( Figure 3.55 ). Next, click a sprite to rotate on the Stage. Move the Rotation and Skew tool into the selected sprite to select the Rotation tool. Click and drag to rotate the sprite; release the mouse button when the result looks right to you.

    Figure 3.55. You can also rotate sprites with the Rotation and Skew tool in the Tools palette.

    graphics/03fig55.gif

  • To rotate a sprite in 90-degree increments , select a sprite and then choose Modify > Transform > Rotate Left, or Modify > Transform > Rotate Right.


To flip a sprite:

  1. Select a sprite in the Score or on the Stage.

  2. Choose Modify > Sprite > Properties.

  3. Click Flip Horizontal or Flip Vertical ( Figure 3.56 ) to flip the sprite either horizontally or vertically ( Figure 3.57 ).

    Figure 3.56. The Flip Horizontal and Flip Vertical buttons of the Property Inspector's Sprite tab.

    graphics/03fig56.gif

    Figure 3.57. Sprites may be flipped horizontally or vertically.

    graphics/03fig57.jpg

graphics/tick.gif Tip

  • When you flip a sprite, you're creating a mirror image of that sprite.


To skew a sprite:

  1. Select a sprite in the Score or on the Stage ( Figure 3.58 ).

    Figure 3.58. Select a sprite to skew.

    graphics/03fig58.gif

  2. Choose Modify > Sprite > Properties.

  3. Type a value in the skew-angle box ( Figure 3.59 ).

    Figure 3.59. Type a value in the skewangle field.

    graphics/03fig59.gif

    A positive value skews the sprite to the right ( Figure 3.60 ); a negative value skews it to the left. Entering 90 (degrees) flattens the sprite.

    Figure 3.60. The sprite, skewed 45 degrees to the right.

    graphics/03fig60.gif

graphics/tick.gif Tips

  • You can also skew sprites with the Rotation and Skew tool in the Tool palette. First, choose Window > Tool Palette, and click the Rotation and Skew tool ( Figure 3.61 ). Next, click a sprite on the Stage. Move the Rotation and Skew tool to the border of the selected sprite to select the Skew tool. Click and drag to skew the sprite.

    Figure 3.61. The Rotation and Skew tool offers another way to skew sprites.

    graphics/03fig61.gif

  • After resizing, rotating, and skewing a sprite, you may want to restore its original shape and orientation. To do so, select the sprite and then choose Modify > Transform > Reset All.


To change a sprite's color :

  1. Select a sprite in the Score or on the Stage.

  2. Choose Modify > Sprite > Properties.

  3. To change black portions of the sprite to a new color, open the foreground color menu ( Figure 3.62 ).

    Figure 3.62. The foreground and background color menus in the Property Inspector can be used to change the colors of black-and-white sprites.

    graphics/03fig62.gif

    or

    To change white portions of the sprite to a new color, open the background color menu.

  4. Choose a color from the available palette colors or from the color picker.

graphics/tick.gif Tips

  • You can change any sprite's color, but doing so is only recommended for sprites based on black-and-white cast members. Attempting to change the colors of sprites based on multicolored cast members will result in unpredictable and often undesirable color changes.

  • If you have a group of cast members that are identical except for their color, you can reduce the file size of your Director movie by deleting all but one of them. Change the remaining cast member to black and white by choosing Modify > Transform Sprite and selecting a color depth of 1 bit. You can then create multiple sprites of different colors from the single black-and-white cast member.


To change the transparency of a sprite:

  1. Select a sprite in the Score or on the Stage.

  2. Choose Modify > Sprite > Properties.

  3. Type a new value in the Blend box, or select a value from the pop-up menu ( Figure 3.63 ).

    Figure 3.63. Set a new blend percentage by typing in a value or choosing one from the pop-up menu.

    graphics/03fig63.gif

    A 100 percent blend makes a sprite completely opaque , while a 0 percent blend makes the sprite totally transparent.

To make a sprite leave a trail on the Stage:

  1. Select a sprite in the Score or on the Stage.

  2. Choose Modify > Sprite > Properties.

  3. Click the Trails button in the Property Inspector ( Figure 3.64 ).

    Figure 3.64. The Trails button in the Property Inspector.

    graphics/03fig64.gif

    When you play the movie, the sprite will leave a trail of duplicates of itself ( Figure 3.65 ).

    Figure 3.65. You can set a sprite to leave a trail of images as it moves.

    graphics/03fig65.gif

graphics/tick.gif Tip

  • The Trails feature can be used to create an animated handwriting effect. See "Real-Time Recording" in Chapter 4, "Animating Sprites."


To set a sprite to be moveable during movie playback:

  1. Select a sprite in the Score or on the Stage.

  2. Choose Modify > Sprite > Properties.

  3. Click the Moveable button in the Property Inspector ( Figure 3.66 ).

    Figure 3.66. The Moveable button in the Property Inspector.

    graphics/03fig66.gif

    It now becomes possible for users to drag the sprite around the Stage while the movie is playing.

graphics/tick.gif Tip

  • This feature is useful in games or in educational applications in which you want to allow users to rearrange items on the screen.


   


Macromedia Director MX for Windows and Macintosh. Visual QuickStart Guide
Macromedia Director MX for Windows and Macintosh. Visual QuickStart Guide
ISBN: 1847193439
EAN: N/A
Year: 2003
Pages: 139

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net