Пример #1
0
void CFlashUIMCVisibleBaseNode::GetValues( IUIElement* pElement, bool &bVisible, float &alpha )
{
	IFlashVariableObject* pMc = pElement->GetMovieClip( GetObjectDesc(), GetTmplDesc());
	if (pMc)
	{
		SFlashDisplayInfo info;
		pMc->GetDisplayInfo(info);
		bVisible = info.GetVisible();
		alpha    = info.GetAlpha() / 100.f;
	}
}
Пример #2
0
void CFlashUIGotoAndPlayBaseNode::GotoAndStop( IUIElement* pElement, int frameId, const char* frameName )
{
	IFlashVariableObject* pMc = pElement->GetMovieClip( GetObjectDesc(), GetTmplDesc());
	if (pMc)
	{
		if (frameId > -1)
			pMc->GotoAndStop( frameId );
		else
			pMc->GotoAndStop( frameName );
	}
}
Пример #3
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 );
	}
}
Пример #4
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 );
}
Пример #5
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 );
}
Пример #6
0
void CFlashUIMCPosRotScaleBaseNode::GetValues( IUIElement* pElement, Vec3 &vPos, Vec3 &vRot, Vec3 &vScale )
{
	IFlashVariableObject* pMc = pElement->GetMovieClip( GetObjectDesc(), GetTmplDesc());
	if (pMc)
	{
		SFlashDisplayInfo info;
		pMc->GetDisplayInfo(info);

		vPos.x = info.GetX();
		vPos.y = info.GetY();
		vPos.z = info.GetZ();

		vRot.x = info.GetXRotation();
		vRot.y = info.GetYRotation();
		vRot.z = info.GetRotation();

		vScale.x = info.GetXScale() / 100.f;
		vScale.y = info.GetYScale() / 100.f;
		vScale.z = info.GetZScale() / 100.f;
	}
}
Пример #7
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 );
}
Пример #8
0
void CFlashUIMCPosRotScaleBaseNode::SetValues( IUIElement* pElement, const Vec3 &vPos, const Vec3 &vRot, const Vec3 &vScale )
{
	IFlashVariableObject* pMc = pElement->GetMovieClip( GetObjectDesc(), GetTmplDesc());
	if (pMc)
	{
		SFlashDisplayInfo info;
		pMc->GetDisplayInfo(info);

		info.SetX( vPos.x );
		info.SetY( vPos.y );
		info.SetZ( vPos.z );

		info.SetRotation( vRot.z );
		info.SetXRotation( vRot.x );
		info.SetYRotation( vRot.y );

		info.SetXScale( vScale.x * 100.f );
		info.SetYScale( vScale.y * 100.f );
		info.SetZScale( vScale.z * 100.f );

		pMc->SetDisplayInfo( info );
	}
}