Exemplo n.º 1
0
//------------------------------------------------------------------------
int CScriptBind_UIAction::GotoAndPlay( IFunctionHandler *pH, const char * elementName, int instanceID, const char * mcName, int frameNum )
{
	IUIElement* pElement = GetElement( elementName, instanceID );
	if ( pElement )
	{
		IFlashVariableObject* pMC = pElement->GetMovieClip( mcName );
		if ( pMC )
		{
			pMC->GotoAndPlay( frameNum );
			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 );
}
Exemplo n.º 2
0
//------------------------------------------------------------------------
int CScriptBind_UIAction::GetScale( IFunctionHandler *pH, const char * elementName, int instanceID, const char * mcName )
{
	IUIElement* pElement = GetElement( elementName, instanceID );
	if ( pElement )
	{
		IFlashVariableObject* pMC = pElement->GetMovieClip( mcName );
		if ( pMC )
		{
			SFlashDisplayInfo info;
			pMC->GetDisplayInfo( info );
			return pH->EndFunction( Script::SetCachedVector( Vec3( info.GetXScale(), info.GetYScale(), info.GetZScale() ), pH, 1 ) );
		}
		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 );
}
Exemplo n.º 3
0
//------------------------------------------------------------------------
int CScriptBind_UIAction::SetVisible( IFunctionHandler *pH, const char * elementName, int instanceID, const char * mcName, bool bVisible )
{
	IUIElement* pElement = GetElement( elementName, instanceID );
	if ( pElement )
	{
		IFlashVariableObject* pMC = pElement->GetMovieClip( mcName );
		if ( pMC )
		{
			SFlashDisplayInfo info;
			pMC->GetDisplayInfo( info );
			info.SetVisible( bVisible );
			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 );
}