#include <libsswf.h>
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 | ParseTag (swf_tag_t tag, const Data &data) |
Parse data from a file into a Sprite tag. | |
virtual ErrorManager::error_code_t | PreSave (void) |
Defines the minimum version necessary to save this 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.
TagSprite::TagSprite | ( | TagBase * | parent | ) |
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:
child_name | The name of the child to be added to this parent |
sswf::TagSprite::OnNewChild(const char *child)
Reimplemented from sswf::TagBase.
References sswf::ErrorManager::ERROR_CODE_INCOMPATIBLE_CHILD, and sswf::ErrorManager::ERROR_CODE_NONE.
ErrorManager::error_code_t TagSprite::ParseTag | ( | swf_tag_t | tag, | |
const Data & | data | |||
) | [private, virtual] |
This function reads the data associated with this sprite object.
[in] | tag | The tag that generated this call |
[in] | data | The Data buffer from the Flash file being loaded |
Implements sswf::TagBase.
References sswf::ErrorManager::ERROR_CODE_NONE, sswf::Data::GetShort(), sswf::TagScalingGrid::ParseGridTag(), sswf::TagBaseID::ParseID(), and sswf::TagBase::SWF_TAG_DEFINE_SCALING_GRID.
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.
References sswf::TagScalingGrid::GridPreSave(), sswf::TagBase::MinimumVersion(), and sswf::TagBase::PreSave().
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.
data | The Data buffer in which the sprite is to be saved |
Implements sswf::TagBase.
References sswf::Data::Append(), sswf::Data::ByteSize(), sswf::TagBase::Children(), sswf::ErrorManager::ERROR_CODE_NONE, sswf::TagBase::FrameCount(), sswf::TagScalingGrid::GridSave(), sswf::TagBaseID::Identification(), sswf::TagBase::Name(), sswf::TagBase::Next(), sswf::Data::OverwriteShort(), sswf::Data::PutShort(), sswf::TagBase::ResetFrames(), sswf::TagBase::Save(), sswf::TagBaseID::SaveID(), sswf::TagBase::SaveTag(), sswf::TagBase::ShowFrame(), sswf::TagBase::SWF_TAG_DEFINE_SPRITE, sswf::TagBase::SWF_TAG_END, and sswf::TagBase::SWF_TAG_SHOW_FRAME.
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.
Implements sswf::TagBase.
References SWF_TYPE_DEFINE, SWF_TYPE_HAS_ID, SWF_TYPE_REFERENCE, SWF_TYPE_SCRIPT, and SWF_TYPE_SPRITE.