Media Types
Bitmaps and palettes, fields and text, shapes and vectors, sound, digital video, Flash members, film loops, and Shockwave 3D.
Bitmaps and palettes
The workhorse type. Properties and behavior that matter:
- Bit depths: 1, 2, 4, 8 (indexed with palette), 16, 32 (direct color, optional alpha).
- Palettes: an 8-bit member references a palette (built-in symbols like
#systemWin,#systemMac,#grayscale, or a palette cast member). Pixels are indices; visible color = palette lookup at draw time. The frame palette (palette channel) governspaletteIndex()colors and 8-bit rendering on indexed displays. - Row alignment: bitmap rows are stored word-aligned (rowBytes even, typically 2-byte aligned from the Mac heritage); parsers of
BITDchunks must respect rowBytes rather than width*depth. - Compression:
BITDdata is RLE-compressed (PackBits-style) for depths <= 8 unless flagged raw. - Import formats: BMP/DIB, PICT, GIF, JPEG, PNG (later versions), Photoshop via Xtras. Imports convert to internal bitmap storage; JPEG-imported members can retain the original JPEG data for size (
imageCompression,imageQuality). - 32-bit alpha:
useAlphagates whether the alpha channel participates;alphaThresholdgates hit tests.extractAlpha/setAlphamanipulate the channel via imaging Lingo. - Animated GIF members play their frames automatically (or via
rewind()/pause()control), withdirectToStageoption.
Imaging Lingo (Director 8+)
img = image(200, 100, 32)
img.copyPixels(member("src").image, rect(0,0,50,50), member("src").rect)
img.copyPixels(src, destQuad, srcRect, [#ink: 36, #color: rgb(255,0,0), \
#blendLevel: 128, #maskImage: msk, #maskOffset: point(0,0)])
img.setPixel(10, 10, rgb(255, 0, 0))
c = img.getPixel(10, 10)
img.draw(rect(0,0,199,99), [#shapeType: #rect, #lineSize: 1, #color: rgb(0,0,0)])
img.fill(rect(2,2,40,40), rgb(200,200,200))
img.crop(rect(0,0,100,50))
member("target").image = img -- assign back to a member
(the stage).image -- read the composited stagecopyPixels accepts a destination quad (four points) for arbitrary distortion, honors ink/blend/mask parameters per call, and is the foundation of every dynamic rendering trick in late-era Shockwave games (photo frames, minimaps, camera captures). Exact pixel semantics recovered from the native compositor are in Native rendering.
Fields and Text
Two text systems (see also Cast members):
Field (#field) | Text (#text) | |
|---|---|---|
| Era | Director 1+ | Director 7+ |
| Rendering | Bitmap fonts, no anti-aliasing | Compositor with anti-aliasing, kerning |
| Rich content | Per-chunk font/size/style/color | Full RTF/HTML import, hyperlinks |
| Editable | Yes | Yes |
| Key properties | text, font, fontSize, fontStyle, alignment, wordWrap, boxType (#adjust/#fixed/#scroll/#limit), border, margin, scrollTop, lineHeight | plus html, rtf, antiAlias, kerning, fixedLineSpace, charSpacing, hyperlinks |
| Measurement | lineCount, lineHeight(), locToCharPos, charPosToLoc, linePosToLocV | plus charSpacing, pointToChar, pointToWord, pointToLine, pointToParagraph |
Compatibility notes:
- Field metrics come from the bitmap font strike: line advance is the authored
lineHeight, glyph placement uses font metrics (advance + bearings), not visible ink bounds. Pixel-exact field rendering is a major fidelity area for UI-heavy games; see the recovered rules in Native rendering. - Editable fields participate in focus: click to focus, typing inserts,
the selStart/the selEndselect, keyboard handlers mustpassfor typing to reach the field. - Text encoding is single-byte until D11: MacRoman or Windows-1252 by authoring platform; XMED-era text sections decode as MacRoman.
- Buttons (
#button) are field variants withbuttonType(#pushButton/#checkBox/#radioButton) andhilitestate.
Shapes and vector shapes
- Shape members (
#shape): QuickDraw-era rects/rounded rects/ovals/lines withshapeType,filled,pattern,lineSize, plus sprite foreColor/backColor. Cheap and everywhere in old UI. - Vector shape members (
#vectorShape): Director 7+ Bezier paths with gradients (vertexList,strokeColor,fillMode), anti-aliased, scalable.
Shape rendering uses the sprite's colors at draw time; a shape member has no pixels of its own. Native caution: unknown/undecodable authored shape metadata must render as transparent, not as an opaque fabricated box.
Sound
- Two Score sound channels plus 6 more addressable from Lingo (8 total mixable):
sound(n).play(member("x")),puppetSound 2, "click",sound playFile 3, "song.mp3". - Channel API:
play,queue,pause,stop,rewind,fadeIn/fadeOut/fadeTo,volume(0-255),pan,status,elapsedTime,loopCount. - Cue points (authored in AIFF/WAV/SWA) fire
on cuePassed channel, number, nameand drive lip-sync/subtitle systems;isPastCuePoint(),mostRecentCuePointquery them. - Shockwave Audio (SWA): streaming compressed audio members with
preLoadBuffer,percentStreamed, andstreamNameURL sourcing. MP3 files are playable as SWA. the soundEnabled,the soundLevelare global gates.
Digital video
QuickTime (#quickTimeMedia), Video for Windows/AVI (#digitalVideo), Windows Media, RealMedia, and (Director 11+) DVD members. Key shared properties: directToStage (video draws over everything; default TRUE and much faster), controller, pausedAtStart, currentTime, movieRate (0 paused / 1 playing; scrubbing via assignment), movieTime, track APIs, mask (QuickTime masking member).
For preservation, video members are the most platform-entangled type; emulators generally remap the media to modern codecs and reimplement the property surface.
Flash members
Director could host Flash movies (#flash) with deep integration: play(), stop(), goToFrame, frame, playBackMode, quality, scaleMode, getVariable/setVariable, getFlashProperty/setFlashProperty, tellTarget, hitTest, flashToStage/stageToFlash coordinate mapping, and externalEvent callbacks from ActionScript into Lingo. Habbo and many web games embedded Flash for effects or vector UI. Emulating this pairing requires a Flash runtime (e.g. Ruffle) bridged through these APIs.
Film loops
A film loop member captures a Score excerpt (channels x frames) as one member; the sprite showing it plays the excerpt on loop. Internal sprites keep their own members/inks; the outer sprite's ink, blend, and rect apply to the composed result. Film loops are nested score renders (not flattened video) and respect regPoint, making them the classic tool for multi-part character animation.
Shockwave 3D
Director 8.5's real-time 3D: #shockwave3D members contain a scene graph (models, model resources, shaders, textures, lights, cameras, groups, motions) with a large dedicated API (the 3D sections of the API reference). Games use newModel, newModelResource primitives, cloneModelFromCastmember, keyframe/bones players, registerForEvent, and collision callbacks. Full 3D emulation is a separate project from classic 2D Director; document links: addBackdrop/addOverlay (2D-in-3D), modelUnderLoc (picking), transform math (vector, transform, preRotate...).