Gnash  0.8.10
Public Member Functions
gnash::MorphShape Class Reference

A DisplayObject that tweens between two shapes. More...

#include <MorphShape.h>

Inheritance diagram for gnash::MorphShape:
gnash::DisplayObject gnash::GcResource

List of all members.

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::ShapeRecordshape () const

Detailed Description

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.


Constructor & Destructor Documentation

gnash::MorphShape::MorphShape ( movie_root mr,
as_object object,
const SWF::DefineMorphShapeTag def,
DisplayObject parent 
)

Member Function Documentation

void gnash::MorphShape::display ( Renderer renderer,
const Transform xform 
) [virtual]

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]
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.

Parameters:
xPoint x coordinate in world space
yPoint y coordinate in world space
Returns:
Whether (x, y) is within the DisplayObject's bounds.

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]

The documentation for this class was generated from the following files: