IID_IMoaMmGC2
PIMoaMmGC2
IMoaUnknown
typedef MoaUlong MoaMmXSpriteCapsFlags; #define kMoaMmXSpriteCapsFlags_None 0 #define kMoaMmXSpriteCapsFlags_IsStatic 1 /* sprite doesn't want CollectChgs() calls, use InvalSpriteRect() to request update */ #define kMoaMmXSpriteCapsFlags_AutoTabEnabled 2 /* app handles tab key */ #define kMoaMmXSpriteCapsFlags_SupportsRotation 0x04 #define kMoaMmXSpriteCapsFlags_SupportsSkew 0x08 #define kMoaMmXSpriteCapsFlags_SupportsFlipH 0x10 #define kMoaMmXSpriteCapsFlags_SupportsFlipV 0x20 #define kMoaMmXSpriteCapsFlags_SupportsQuad 0x40 #define kMoaMmXSpriteCapsFlags_SupportsAutoBounds 0x80
When a sprite gets rotated or skewed, its bounding rectangle normally changes to reflect the new maximum X and Y extents of the image on the stage. Setting SupportsAutoBounds tells Director that your Xtra is ready for Director to change its bounding box as the sprite is rotated or skewed. If you do not set this constant, Director will not adjust the bounding rectangle with the result that the sprite is cropped to the area of the original rectangle.
typedef MoaLong MoaMmBlitState; /* This is set if the author wants Director to use the quad / parameter in the MoaMmBlitParams structure to do the Blit. If / it's not set, the DstRect parameter to the function will be used. / Rotation/skew/flipH/flipV are OUTPUT values only, there are / ignored for the Blit2 call. */ #define kMoaMmBlit_UseQuadForBlit 1 typedef struct { MoaFloat rotation; MoaFloat skew; MoaBool flipH; MoaBool flipV; MoaFloat quad[4][2]; MoaMmBlitState flags; } MoaMmBlitParams; typedef MoaMmBlitParams FAR * PMoaMmBlitParams; typedef const MoaMmBlitParams FAR * ConstPMoaMmBlitParams; typedef struct { MoaRect spriteRect; /* rect on stage where sprite appears */ MoaMmXSpriteImageMode imageMode; /* imaged direct or to an offscreen buffer */ MoaMmXSpriteFlags flags; /* sprite FX flags (see above) */ MoaMmInk ink; /* sprite ink mode */ MoaMmInkParams inkParams; /* extra params for some inks */ MoaMmBlitParams blitParams; /* extra params for Director blit functionality */ MoaLong aux; /* reserved */ } MoaMmXSpriteInfo; typedef MoaMmXSpriteInfo FAR * PMoaMmXSpriteInfo; typedef const MoaMmXSpriteInfo FAR * ConstPMoaMmXSpriteInfo;
IMoaMmGC2
interface allows access to alpha channel support and rotation/skew/quad support.
- Blit2(PIMoaMmGC2 This,
- ConstPMoaRect pDestRect,
- struct IMoaMmGC FAR * pSrcGC,
- ConstPMoaRect pSrcRect,
- MoaMmInk ink,
- ConstPMoaMmInkParams pInkParams,
- ConstPMoaMmBlitParams pBlitParams,
- struct IMoaMmGC FAR * pAlphaGC,
PMoaVoid nativeClipRegion)
This
IMoaMmGC2
interfacepDestRect
ConstPMoaRect
Represents the area to which to copypSrcGC
struct IMoaMmGC FAR *
pSrcRect
ConstPMoaRect
ink
MoaMmInk
pInkParams
ConstPMoaMmInkParams
Optional ConstPMoaMmInkParams
specifying ink parameterspBlitParams
ConstPMoaMmBlitParams
A pointer to a MoaMmBlitParam
structure that contains relevant information on how to perform the blitting. The rotation/skew/flipH/flipV are output values only. Director passes these out to the Xtra during the image call so that the Xtra can use the values to image. It also passes out a quad parameter, which is the 4 point quad to use to distort the source image. This can be an input parameter for the Blit2()
call, depending on the flags setting. If flags has the blit flag kMoaMmBlit_UseQuadForBlit
set, the Blit2()
call will use the quad. Otherwise, it will use the DstRect
value.pAlphaGC
struct IMoaMmGC FAR *
A pointer to an IMoaMmGc
interface. This GC should contain the alpha bitmap used for blitting. If there is no alpha bitmap, pass in NULL to the call. The alpha bitmap can be 1, 2, 4, 8, or 32 bits deep. For 8-bit, 0x00 is transparent and 0xFF is opaque with the intermediate values a linear range of transparency settings. The other low-bit bitmaps have the same behavior. The 32-bit bitmap has an alpha value for each color channel so you can perform different alpha on R, G, and B.nativeClipRegion
PMoaVoid
Macintosh RgnHandle
or Windows HRGN
MoaError
Blit2()
is a extension of the Blit()
method in the IMoaMmGC
interface.kMoaMmXSpriteFlags_ExtendedInfo
flag in the flags parameter of the MoaMmXSpriteInfo
structure of the Image call. If this flag is set, the MoaMmXSpriteInfo
has the MoaMmBlitParams
parameter as part of its structure and you can reference this parameter. Also, you can use Blit2()
safely if this flag is set. Blit2()
, all the following flags can be set. If the Xtra supports only a subset (Flash asset, for example), set the appropriate flags and Director will not allow some features (like quadding). AutoBounds
means that the Xtra wants its bounds to grow as it is rotated or quadded. Turning this off allows the Xtra to image into its fixed rectangle, like a portal view.
#define kMoaMmXSpriteCapsFlags_SupportsRotation 0x04 #define kMoaMmXSpriteCapsFlags_SupportsSkew 0x08 #define kMoaMmXSpriteCapsFlags_SupportsFlipH 0x10 #define kMoaMmXSpriteCapsFlags_SupportsFlipV 0x20 #define kMoaMmXSpriteCapsFlags_SupportsQuad 0x40 #define kMoaMmXSpriteCapsFlags_SupportsAutoBounds 0x80