Example #1
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 );
	}
}
Example #2
0
//------------------------------------------------------------------------
int CScriptBind_UIAction::SetRotation( IFunctionHandler *pH, const char * elementName, int instanceID, const char * mcName, Vec3 vRotation )
{
	IUIElement* pElement = GetElement( elementName, instanceID );
	if ( pElement )
	{
		IFlashVariableObject* pMC = pElement->GetMovieClip( mcName );
		if ( pMC )
		{
			SFlashDisplayInfo info;
			pMC->GetDisplayInfo( info );
			info.SetXRotation( vRotation.x );
			info.SetYRotation( vRotation.y );
			info.SetRotation( vRotation.z );
			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 );
}