Director Help

Resizing and scaling sprites

You can resize sprites directly on the Stage by dragging their handles. To resize the sprite precisely, enter coordinates or scale sprites by a specified percentage on the Sprite tab in the Property inspector. You can also set the sprite’s size with Lingo or JavaScript syntax.

Changing a sprite’s size on the Stage does not change the size of the cast member that is assigned to the sprite. The size of the sprite is not affected if you resize its cast member.

In some cases, resizing bitmap sprites can cause noticeable delays. If a bitmap sprite must be of a particular size, properly size the cast members that appear in the sprite. You can do this with Modify > Transform Bitmap or in any image-editing program. Scaling and resizing sprites works best with vector shapes.

Note: The procedure for resizing a rotated or skewed sprite is different from the following procedures. For more information, see Rotating and skewing sprites.

Resize a sprite by dragging its handles

  1. Select the sprite.
  2. On the Stage, drag any of the sprite’s resize handles. To maintain the sprite’s proportions, hold down Shift while dragging.

Scale a sprite by pixels or by an exact percentage

  1. Select the sprite you want to scale and click the Sprite tab of the Property inspector (Graphical view).
  2. Click the Scale button.
  3. In the dialog box, enter new values to scale the sprite by doing one of the following:
    • Specify a pixel size in the Width or Height text boxes. If Maintain Proportions is selected, all text boxes that can be updated adjust to reflect the new scaled size. If Maintain Proportions is not selected, you can specify new proportions in the Width and Height text boxes.
    • Enter a percentage in the Scale text box.
  4. Click OK.

    The sprite is scaled relative to its current size, not to the size of its parent cast member.

Restore a sprite to its original dimensions

Do one of the following:

  • On the Sprite tab in the Property inspector (Graphical view), click Restore All.
  • Select Modify > Transform > Reset Width and Height or Reset All.

Resize a sprite’s bounding rectangle with script

  • Set the sprite’s quad or rect sprite property. For more information about these properties, see the Scripting Reference topics in the Director Help Panel.

    The rect sprite property determines the coordinates of a sprite’s bounding rectangle. The coordinates are given as a rect value, which is a list of the left, top, right, and bottom coordinates.

Change a sprite’s height or width with script

  • Set the height or width sprite property. For more information about these properties, see the Scripting Reference topics in the Director Help Panel.