quicktime.std.anim
Class SpriteWorld

java.lang.Object
  |
  +--quicktime.QTObject
        |
        +--quicktime.std.anim.SpriteWorld
All Implemented Interfaces:
quicktime.jdirect.InterfaceLib, quicktime.jdirect.PrimitivesLib, quicktime.jdirect.QuickTimeLib, quicktime.jdirect.SharedLibrary, com.apple.jdirect.SharedLibrary

public class SpriteWorld
extends QTObject
implements quicktime.jdirect.QuickTimeLib

The SpriteWorld class implements the corresponding data structure of the Movie Toolbox. Your application can use SpriteWorld's to make animations. A Sprite World handles the common tasks of invalidating appropriate areas as sprite properties change, the composition of sprites and their background on an offscreen buffer, and the blitting of the result to the screen or alternate destination.


Fields inherited from interface quicktime.jdirect.QuickTimeLib
JDirect_MacOSX, libraryInstance, name
 
Constructor Summary
SpriteWorld(QDGraphics port, QDGraphics spriteLayer, QDColor backgroundColor, QDGraphics background)
          This constructor creates a new sprite world.
 
Method Summary
 QDRect getBounds()
          Returns the current bounds of the SpriteWorld.
 Matrix getMatrix()
          Returns the current transformational matrix used by the sprite world
 Sprite hitTest(int flags, QDPoint loc)
          This method is used to determine if a sprite exists at a certain location.
 int idle(int flagsIn)
          This method allows the sprite world to update and redraw the invalid portions of the sprite world.
 void invalidate(QDRect invalidArea)
          This method allows a rectangular area of the sprite world to be invalidated, which will force it to redraw the next time SpriteWorldIdle is called.
 void setBounds(QDRect bounds)
          Sets the bounds of the SpriteWorld by scaling its matrix.
 void setClip(Region clipRgn)
          This method sets the sprite world's clip.
 void setFlags(int flags, int flagsMask)
          Set the flags for the sprite world.
 void setGraphicsMode(GraphicsMode gMode)
          This method sets the Graphic's mode of the SpriteWorld.
 void setMatrix(Matrix matrix)
          This method sets the sprite world's matrix.
 
Methods inherited from class quicktime.QTObject
disposeQTObject, equals, ID, toString
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpriteWorld

public SpriteWorld(QDGraphics port,
                   QDGraphics spriteLayer,
                   QDColor backgroundColor,
                   QDGraphics background)
            throws QTException
This constructor creates a new sprite world.

QuickTime::NewSpriteWorld()

Parameters:
port - the target destination of the SpriteWorld. This may NOT be null.
spriteLayer - Specifies the mSpriteGWorld QDGraphics.
backgroundColor - Specifies the background color.
background - Specifies the background QDGraphics that can be used for better performance when you have background sprites
Method Detail

setBounds

public final void setBounds(QDRect bounds)
                     throws StdQTException
Sets the bounds of the SpriteWorld by scaling its matrix.
Parameters:
bounds - the new size of the SpriteWorld

getBounds

public final QDRect getBounds()
                       throws StdQTException
Returns the current bounds of the SpriteWorld.
Returns:
the bounds of the SpriteWorld

setClip

public final void setClip(Region clipRgn)
                   throws StdQTException
This method sets the sprite world's clip.

QuickTime::SetSpriteWorldClip()

Parameters:
clipRgn - Specifies the clipping region.

setGraphicsMode

public final void setGraphicsMode(GraphicsMode gMode)
                           throws StdQTException
This method sets the Graphic's mode of the SpriteWorld.

QuickTime::SetSpriteWorldGraphicsMode()

Parameters:
gMode - the new graphic's mode for the SpriteWorld

getMatrix

public final Matrix getMatrix()
Returns the current transformational matrix used by the sprite world
Returns:
the current matrix.

setMatrix

public final void setMatrix(Matrix matrix)
                     throws StdQTException
This method sets the sprite world's matrix.

QuickTime::SetSpriteWorldMatrix()

Parameters:
matrix - Specifies the Matrix.

idle

public final int idle(int flagsIn)
               throws StdQTException
This method allows the sprite world to update and redraw the invalid portions of the sprite world.

QuickTime::SpriteWorldIdle()

Parameters:
flagsIn - Contains flags describing what type of actions may take place during the idle, such as if drawing to the final destination should be pressed.
Returns:
Flags describing what type of actions took place during the idle, such as if any drawing took place.

invalidate

public final void invalidate(QDRect invalidArea)
                      throws StdQTException
This method allows a rectangular area of the sprite world to be invalidated, which will force it to redraw the next time SpriteWorldIdle is called.

QuickTime::InvalidateSpriteWorld()

Parameters:
invalidArea - A Rectangle which describes the invalid rectangle in sprite world source space.

hitTest

public final Sprite hitTest(int flags,
                            QDPoint loc)
                     throws QTException
This method is used to determine if a sprite exists at a certain location.

QuickTime::SpriteWorldHitTest()

Parameters:
flags - This allows the hit testing operation to be controlled more precisely.
loc - The point that you wish to test.
Returns:
the Sprite object which received the hit, or null if no sprite at that location.

setFlags

public final void setFlags(int flags,
                           int flagsMask)
                    throws StdQTException
Set the flags for the sprite world.

QuickTime::SetSpriteWorldFlags()

Parameters:
flag - the value you wish to set the property to
flagMask - the property that you want to effect