Public Member Functions

gnash::Shape Class Reference

For DisplayObjects that don't store unusual state in their instances. More...

#include <Shape.h>

Inheritance diagram for gnash::Shape:
Inheritance graph
[legend]
Collaboration diagram for gnash::Shape:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Shape (movie_root &mr, as_object *object, boost::shared_ptr< DynamicShape > sh, DisplayObject *parent)
 Shape (movie_root &mr, as_object *object, const SWF::DefineShapeTag *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.

Detailed Description

For DisplayObjects that don't store unusual state in their instances.

A Shape may be either statically constructed during parsing or, in AS3, dynamically constructed. A SWF-parsed Shape has an immutable SWF::DefinitionTag. A dynamic Shape object has a DynamicShape.


Constructor & Destructor Documentation

gnash::Shape::Shape ( movie_root mr,
as_object object,
boost::shared_ptr< DynamicShape sh,
DisplayObject parent 
) [inline]
gnash::Shape::Shape ( movie_root mr,
as_object object,
const SWF::DefineShapeTag def,
DisplayObject parent 
) [inline]

Member Function Documentation

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

Render the DisplayObject.

All DisplayObjects must have a display() function.

Implements gnash::DisplayObject.

virtual SWFRect gnash::Shape::getBounds (  )  const [inline, virtual]

Implements gnash::DisplayObject.

bool gnash::Shape::pointInShape ( boost::int32_t  x,
boost::int32_t  y 
) const [virtual]

Return true if the given point falls in this DisplayObject's shape.

Parameters:
x Point x coordinate in world space
y Point 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::geometry::Point2d::x, gnash::key::x, gnash::geometry::Point2d::y, and gnash::key::y.


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