







virtual f32 GetOpacity( s32 index=0 ) { return _opacity[ index ]; }
virtual void SetOpacity( f32 nA, s32 index=0 ) { _opacity[ index ] = core::clamp<f32>( nA, 0, 255 ); }
const core::stringw& GetInternalName() const { return _internalName; }
void SetInternalName( const core::stringw& name ) { _internalName = name; }
template< class T >
T findChild( const NrpText& internalName, bool recursiveFind = false ) const
{
if( IGUIElement* mySelf = core::nrp_cast< IGUIElement* >( this ) )
{
const core::list< IGUIElement* > &children = mySelf->getChildren();
core::list< IGUIElement* >::ConstIterator it = children.begin();
for( ; it != children.end(); it++ )
{
if( INrpElement* elm = core::nrp_cast< INrpElement* >( *it ) )
{
if( elm->GetInternalName() == internalName )
return core::nrp_cast< T >( *it );
if( recursiveFind )
{
T chElm = elm->findChild< T >( internalName, recursiveFind );
if( chElm )
return chElm;
}
}
}
}
return NULL;
}
template< class T >
void findChildren( core::array< T >& childrens ) const
{
if( IGUIElement* mySelf = core::nrp_cast< IGUIElement* >( this ) )
{
const core::list< IGUIElement* > &children = mySelf->getChildren();
core::list< IGUIElement* >::ConstIterator it = children.begin();
for( ; it != children.end(); it++ )
{
if( T elm = core::nrp_cast< T >( *it ) )
childrens.push_back( *it );
}
}
}
virtual IGUIFont* GetOverrideFont( u32 index=0 ) const
{
FONTS_MAP::Node* ret = _overrideFonts.find( index );
return ret ? ret->getValue() : NULL;
}
virtual void SetOverrideFont( u32 nA, IGUIFont* font )
{
_overrideFonts[ nA ] = font;
}







Return to Project Announcements
Users browsing this forum: No registered users and 1 guest