Ejemplo n.º 1
0
//------------------------------------------------------------------------
int CScriptBind_UIAction::GetPos( 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.GetX(), info.GetY(), info.GetZ() ), 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 );
}
Ejemplo n.º 2
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;
	}
}