sswf::TagSprite Class Reference

Group shapes, sprites, texts, buttons, sound, etc. More...

#include <libsswf.h>

Inheritance diagram for sswf::TagSprite:

sswf::TagBaseID sswf::TagScalingGrid sswf::TagBase sswf::MemoryManager List of all members.

Public Member Functions

virtual ErrorManager::error_code_t Save (Data &data)
 Save a Sprite control list.
 TagSprite (TagBase *parent)
 Initialize a sprite.
virtual swf_type_t TypeFlags (void) const
 Returns the flags defining a TagSprite object.

Protected Member Functions

virtual ErrorManager::error_code_t OnNewChild (const char *child_name) const
 Check that the child is valid for a TagSprite.

Private Member Functions

virtual ErrorManager::error_code_t PreSave (void)
 Defines the minimum version necessary to save this sprite.

Detailed Description

The TagSprite is the SWF object used to group other objects in one single entity. The sprite is given an ID which can later be used to display the sprite.

A sprite can be viewed as a group, though it only includes a set of control tags used to define a display list.

For instance, to include a TagSprite inside another TagSprite you actually need to use a TagPlace which reference the TagSprite to be inserted.

There is one special case sprite: the empty sprite. This is required if you want to use the CreateEmptyMovie() function in some ActionScript!

Since version 1.8.0, a Sprite derives from the sswf::TagScalingGrid. This means you can define a scaling rectangle with a call to the void sswf::TagScalingGrid::SetGrid(const SRectangle& rect) function.

See also:
SWF Alexis' Reference—Define Sprite

SWF Alexis' Reference—swf_tag


Constructor & Destructor Documentation

TagSprite::TagSprite ( TagBase parent  ) 

By default, a TagSprite is created empty. You can add objects using the Sprite object as the parent of other objects (instead of the TagHeader.)


Member Function Documentation

ErrorManager::error_code_t TagSprite::OnNewChild ( const char *  child_name  )  const [protected, virtual]

A sswf::TagSprite accepts only a few control tags as defined in my reference.

This function returns an error if the child is not one of these control tags:

Parameters:
child_name The name of the child to be added to this parent
Returns:
An error code: ErrorManager::ERROR_CODE_NONE or ErrorManager::ERROR_CODE_INCOMPATIBLE_CHILD
See also:
sswf::TagBase::OnNewChild(const char *child)

sswf::TagSprite::OnNewChild(const char *child)

Reimplemented from sswf::TagBase.

ErrorManager::error_code_t TagSprite::PreSave ( void   )  [private, virtual]

Sprites appeared in version 3 of SWF.

Since version 8 of SWF, it is possible to attached a scaling grid to a sprite (by referencing the sprite in the scaling grid.)

When no grid is defined, then a version 3 movie is sufficient.

When a grid is defined, then a version 8 or better is required.

Reimplemented from sswf::TagBase.

ErrorManager::error_code_t TagSprite::Save ( Data data  )  [virtual]

This function saves all the children defined in this sprite, the Sprite header and when the user did not specify them, the TagShowFrame and TagEnd at the end of the list.

Warning:
The size of the sub-list of tags within a sprite is limited to 64Kb.
Parameters:
data The Data buffer in which the sprite is to be saved
Returns:
An error manager code

Implements sswf::TagBase.

TagBase::swf_type_t TagSprite::TypeFlags ( void   )  const [virtual]

A Sprite is a definition, it includes references to other objects, it accept scripts, it is a sprite and it has an identifier.

Returns:
The set of flags that the TagSprite support

Implements sswf::TagBase.


The documentation for this class was generated from the following files:
Generated on Tue Jun 26 02:36:46 2007 for libsswf by  doxygen 1.4.7