Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
Clippings/CreateKeyFrameSample.txt
////////// |
// |
// create a key frame sample containing the sprites and all of their shared images |
// |
////////// |
// create a new, empty key frame sample |
myErr = QTNewAtomContainer(&mySample); |
if (myErr != noErr) |
goto bail; |
// specify transparency color for recompression |
myKeyColor.red = myKeyColor.green = myKeyColor.blue = 0xffff; // white |
// add images to the key frame sample - AddPICTImageToKeyFrameSample |
// will add the following atom data to the key frame atom container: |
// |
// kSpriteShareDataAtomType |
// kSpriteImagesContainerAtomType |
// kSpriteImageAtomType |
// kSpriteImageDataAtomType |
// |
// and optionally: |
// |
// kSpriteImageRegistrationAtomType |
// kSpriteImageNameAtomType |
AddPICTImageToKeyFrameSample(mySample, kIconPictID, &myKeyColor, kIconImageIndex, NULL, NULL); |
AddPICTImageToKeyFrameSample(mySample, kWorldPictID, &myKeyColor, kWorldImageIndex, NULL, NULL); |
AddPICTImageToKeyFrameSample(mySample, kBackgroundPictID, &myKeyColor, kBackgroundImageIndex, NULL, NULL); |
for (myIndex = 1; myIndex <= kNumSpaceShipImages; myIndex++) |
AddPICTImageToKeyFrameSample(mySample, kFirstSpaceShipPictID + myIndex - 1, &myKeyColor, myIndex + 3, NULL, NULL); |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-14