Example #1
0
void CFlashUIMCVisibleBaseNode::SetValues( IUIElement* pElement, bool bVisible, float alpha )
{
	IFlashVariableObject* pMc = pElement->GetMovieClip( GetObjectDesc(), GetTmplDesc());
	if (pMc)
	{
		SFlashDisplayInfo info;
		pMc->GetDisplayInfo(info);
		info.SetVisible( bVisible );
		info.SetAlpha( alpha * 100.f );
		pMc->SetDisplayInfo( info );
	}
}
Example #2
0
//------------------------------------------------------------------------
int CScriptBind_UIAction::SetAlpha( IFunctionHandler *pH, const char * elementName, int instanceID, const char * mcName, float fAlpha )
{
	IUIElement* pElement = GetElement( elementName, instanceID );
	if ( pElement )
	{
		IFlashVariableObject* pMC = pElement->GetMovieClip( mcName );
		if ( pMC )
		{
			SFlashDisplayInfo info;
			pMC->GetDisplayInfo( info );
			info.SetAlpha( fAlpha );
			pMC->SetDisplayInfo( info );
			return pH->EndFunction( true );
		}
		UIACTION_WARNING( "LUA: Element %s has no movieclip %s", elementName, mcName );
	}
	else
	{
		UIACTION_WARNING( "LUA: UIElement %s does not exist", elementName );
	}
	return pH->EndFunction( false );
}