Expose whether CanvasElement is visible

This commit is contained in:
Thomas Geymayer
2013-02-13 12:09:15 +01:00
parent ba020245f9
commit d661516b02
2 changed files with 11 additions and 0 deletions

View File

@@ -210,6 +210,12 @@ namespace canvas
return true;
}
//----------------------------------------------------------------------------
bool Element::isVisible() const
{
return _transform->getNodeMask() != 0;
}
//----------------------------------------------------------------------------
osg::ref_ptr<osg::MatrixTransform> Element::getMatrixTransform()
{

View File

@@ -82,6 +82,11 @@ namespace canvas
virtual bool hitBound( const osg::Vec2f& pos,
const osg::Vec2f& local_pos ) const;
/**
* Get whether the element is visible or hidden (Can be changed with
* setting property "visible" accordingly).
*/
bool isVisible() const;
osg::ref_ptr<osg::MatrixTransform> getMatrixTransform();