Gnash
0.8.10
|
A DisplayObject that tweens between two shapes. More...
#include <MorphShape.h>
Public Member Functions | |
MorphShape (movie_root &mr, as_object *object, const SWF::DefineMorphShapeTag *def, DisplayObject *parent) | |
virtual void | display (Renderer &renderer, const Transform &xform) |
Render the DisplayObject. | |
virtual SWFRect | getBounds () const |
virtual bool | pointInShape (boost::int32_t x, boost::int32_t y) const |
Return true if the given point falls in this DisplayObject's shape. | |
const SWF::ShapeRecord & | shape () const |
A DisplayObject that tweens between two shapes.
A MorphShape has no properties of its own, but its inherited properties may be read in AS3 using a reference to the object created with getChildAt(). Morphing is controlled using a SWF::PlaceObject2 tag with a ratio flag. The most common and efficient way is to combine this with a move flag, so that this object is moved to the position specified by the ratio. However, it is also possible to remove and replace, in which case a new MorphShape is created. The starting position is not necessarily identical with shape1, though in practice it often is.
gnash::MorphShape::MorphShape | ( | movie_root & | mr, |
as_object * | object, | ||
const SWF::DefineMorphShapeTag * | def, | ||
DisplayObject * | parent | ||
) |
Render the DisplayObject.
All DisplayObjects must have a display() function.
Implements gnash::DisplayObject.
References gnash::DisplayObject::transform(), and gnash::DisplayObject::clear_invalidated().
SWFRect gnash::MorphShape::getBounds | ( | ) | const [virtual] |
Implements gnash::DisplayObject.
References gnash::SWF::ShapeRecord::getBounds(), and gnash::SWFRect::expand_to_rect().
bool gnash::MorphShape::pointInShape | ( | boost::int32_t | x, |
boost::int32_t | y | ||
) | const [virtual] |
Return true if the given point falls in this DisplayObject's shape.
x | Point x coordinate in world space |
y | Point y coordinate in world space |
Implements gnash::DisplayObject.
References gnash::getWorldMatrix(), gnash::SWFMatrix::invert(), gnash::SWFMatrix::transform(), gnash::SWF::ShapeRecord::getBounds(), gnash::SWFRect::point_test(), gnash::geometry::Point2d::x, gnash::geometry::Point2d::y, gnash::geometry::pointTest(), gnash::SWF::ShapeRecord::paths(), and gnash::SWF::ShapeRecord::lineStyles().
const SWF::ShapeRecord& gnash::MorphShape::shape | ( | ) | const [inline] |