Can a projector automatically scale a movie and its sprites to fill bigger or smaller monitors?

The following capability is new to Director 7.0.2:

In Director 7.0.2, the Lingo "drawRect of window" and "rect" can now be used to automatically position and scale both a projector's stage window and the sprites within the movie.

In previous versions of Director this Lingo only produced useful results with movies in a window (MIAWs) and only with shape and bitmap sprites.

In Director 7.0.2, most sprite-types will scale well, especially Vector and shape sprites, Flash sprites and Field sprites. Some sprite-types -- especially bitmaps -- may distort when scaled, but most sprites will look surprisingly good. It most cases, the appearance of sprites is better the closer the original movie stage size is to the final displayed size, and if the displayed size is proportional to the original size. In some movie designs the results may be better if the original stage size is larger than the displayed size, such as when the stage is reduced at runtime.

Note: Embedded Fonts in Text sprites are scaled, but their outlines may not be smooth, even with antialiasing enabled. Text sprites may look better when the stage size is reduced rather than enlarged.

There may be a performance penalty (slow down) in frame-based animation as a result of the additional computational load due to the automatic scaling. Increasing the movie's Tempo can be used to compensate for this if the computer can handle the load. Likewise, digital video media may incur a performance penalty, depending on the video's data rate and the platform's speed.

You should test these techniques carefully in your Director 7.0.2 movies and projectors on your target playback platforms to determine if it's appropriate for your design needs.


In Director 7.0.2, if a movie's stage size is 1024 x 768, but you want the projector window size to be half of normal size (512 x 384), and you want to locate the upper left corner of the projector at the screen coordinates (100, 100), then add the following to the movie's Movie script:

---------------------------------------------- -- Example script for use in Director 7.0.2. -- Enter this Lingo into a _Movie_ script, -- not a behavior script.
  -- Play the movie in a projector using the
  -- "In a window" projector option. on prepareMovie  (the stage).drawRect = rect(0, 0, 512, 384)  (the stage).rect = 

Then make a projector using the "In a window" option. The 1024 x 768 movie should now play in a 512 x 384 projector window, and its sprites will be scaled accordingly.

Here's another example that uses these techniques in a different way. As noted in the comments within the script below, assign the following Behavior script to a button in your movie. This example uses the Lingo "desktopRectList" to determine the dimensions of the monitor, and then scales the projector window to that size:

 --------------------------------------------------------------------- -- Example behavior script for use in Director 7.0.2.
  -- This example determines the main monitor's dimensions -- using the Lingo "desktopRectList",
  -- and then scales the projector window to that size. -- Assign this example behavior script to a button sprite. -- Play the movie in a projector using the
  -- "In a window" projector option. on mouseUp   myDrawRectFullScreen end on myDra

The following techniques can be used in all versions of Director, including version 7.0.2, or as an alternative to the Director 7.0.2-specific technique described above:

Stage size is a fundamental Director movie property, and is set during authoring for the intended playback machine. A movie's stage size is constant on monitors of different sizes. The stage and sprites do not resize automatically to accommodate differently-sized monitors.

Note: The "Full screen" projector option extends the stage color to hide the Mac or Windows desktop. It does not, for example, stretch or scale sprites to fill bigger monitors.

Director works this way because it is optimized for the fast animation of bitmap images. Bitmap images can be animated very quickly, partly because they are pre-rendered. However, bitmap images lose quality (become "pixelated") when enlarged. Other applications, such as Macromedia's Flash, primarily use vector technology instead of bitmaps. The chief advantage of vector graphics is they can be resized with little or no loss of image quality. The disadvantage of vector-based animation is the higher computational load, which can result in slower animation. Developers should use whichever tools is most appropriate for the given task.

If you want a Director movie to look the same on all monitor sizes (and not scale), design the movie with a stage size the size of the smallest playback screen, and play this movie on all monitors, whatever their size.

To fill a larger monitor, design a movie with a bigger stage and bigger sprites whose size corresponds to the larger monitor size.

Alternatively, if you want a movie and its sprites to fill monitors of various sizes, create several otherwise-similar movies with different stage and sprites sizes (corresponding to the various monitor sizes), and play the movie whose stage size most closely matches the monitor. Note: The stage size used should be the same size, or smaller than, the monitor size.

It's possible to design movie(s) that "automatically" play the appropriate size movie for the current monitor, whatever its size. There are different methods that can be used to select which (size) movie to play on which size monitor.

The simplest (but not actually automatic) method is to create separate projectors, each containing a movie or movies with a stage size appropriate for a particular, single monitor size. To assist the user in selecting the appropriate projector to open for their system, you might give the projector files disk names that correspond to the monitor sizes. The user would (hopefully) open whichever projector is appropriate for their monitor. This approach has the advantage of being the easiest to implement, but uses the most disk space because of the multiple projectors.

A more automated method is for a single projector to first play a small-stage-size movie that uses the Lingo "the deskTopRectList" to determine the current monitor size. Once this movie has determined the monitor size, it can navigate to another, appropriately-sized movie (using the Lingo "go to movie"). If the projector option "Use movie settings" is selected, the subsequent (larger) movie will fill the screen. This approach has the advantage of using less disk space, because there is only one projector. However, you still have to create multiple, differently-sized movies.

For a computer that has two monitors, suppose that the value for the deskTopRectList is [rect(0, 0, 1024, 768), rect(1025, 0, 1665, 480)]. The following statement returns the third item from the rect coordinates for the first monitor: put getAt(getAt(the deskTopRectList, 1),3). The result is "1024".

The Lingo "the drawRect of window": This command is used to scale a movie-in-a-window (MIAW), and thus its sprites, at runtime. However, in Director before version 7.0.2, this method has various limitations; for example field sprites don't scale, bitmap sprites may appear pixelated when enlarged, and there may be a performance penalty. This method's advantage is that one design (consisting of a single projector playing as few as one "stub" movie and one MIAW) can be used to "fill" any size monitor.

Thus, you can either change the movie dimensions (in a MIAW) to match the screen, or change the user's screen resolution to match the movie's.

How to change the computer monitor display resolution at runtime:

The user's screen monitor resolution can not be changed using Director or Lingo alone, but can be changed using a custom 3rd party Xtra. For example: Glenn Picher's DisplayRes Xtra or Gary Smith's Buddy API Xtra. For more information on 3rd party Xtras, see:

Note: On Windows, changing monitor resolution is subject to limitations of the operating system version, system configuration or SVGA video device driver software. For example, Windows 95 may require Microsoft's free QuickRes utility to enable on-the-fly display settings. Windows 98, Windows NT4 and the Macintosh OS are normally able to reset monitor resolution without restarting the system. For more information, refer to Microsoft or the 3rd party Windows SVGA video card vendor.

For more information on the Director features discussed above, refer to Director's documentation, online Help and searchable TechNotes.

Adobe logo

Sign in to your account