// ----------------------------------------------------------------------------- // CTestSDKSkins::TestFBCCSetFrameRectsL // ----------------------------------------------------------------------------- TInt CTestSDKSkins::TestFBCCSetFrameRectsL( CStifItemParser& /*aItem*/ ) { TAknsItemID itemID; TPoint pointTL( 0, 0 ); TPoint pointBR( KLength, KLength ); const TInt KOutPoint = 50; TPoint outPoint( KOutPoint, KOutPoint ); const TInt KInPoint = 40; TPoint inPoint( KInPoint, KInPoint ); TRect outRect( pointTL, outPoint ); TRect inRect( pointBR, inPoint ); CAknsFrameBackgroundControlContext* context = CAknsFrameBackgroundControlContext::NewL( itemID, outRect, inRect, ETrue ); CleanupStack::PushL( context ); STIF_ASSERT_NOT_NULL( context ); context->SetFrameRects( outRect, inRect ); CleanupStack::PopAndDestroy( context ); return KErrNone; }
void ZaWindMill::processEvent(ZaEvent * env) { env->m_event = env->m_type; if (env->m_type == ZaEvent::EVENT_DOWN ) { ///ZaTweener::getInstance()->push(this,ZaTweener::ZOOM,1,3,0,3); env->m_event = ZaEvent::EVENT_DOWN; } if (env->m_type == ZaEvent::EVENT_MOVE) { env->m_event = ZaEvent::EVENT_MOVE; } if (env->m_type == ZaEvent::EVENT_UP) { float l_size = 200 + 100.0f*(float) rand()/RAND_MAX; soundplayer_play_sound("input_keypress"); std::vector<ZAImage *>::iterator iter; ZAImage * l_img ; for (iter = m_v.begin();iter != m_v.end();iter++) { if ((*iter)->m_z == 0) { l_img = (*iter); l_img->reset(); l_img->setSize(env->m_x,env->m_y,l_size,l_size); ZaTweener::getInstance()->push(l_img,ZaTweener::X,l_img->m_x,m_width/2,0,150); ZaTweener::getInstance()->push(l_img,ZaTweener::Y,l_img->m_y,m_height/2,0,150); ZaTweener::getInstance()->push(l_img,ZaTweener::ROTATION,0,l_size*10,0,150); ZaTweener::getInstance()->push(l_img,ZaTweener::ZOOM,1,0,0,150); return; } } l_img = new ZAImage(); l_img->LoadImg("app/native/res/fly2.png",l_size,l_size); l_img->setXY(env->m_x,env->m_y); m_v.push_back(l_img); //AddChild(l_img); ZaTweener::getInstance()->push(l_img,ZaTweener::X,l_img->m_x,m_width/2,0,150); ZaTweener::getInstance()->push(l_img,ZaTweener::Y,l_img->m_y,m_height/2,0,150); ZaTweener::getInstance()->push(l_img,ZaTweener::ROTATION,0,l_size*10,0,150); ZaTweener::getInstance()->push(l_img,ZaTweener::ZOOM,1,0,0,150); //post click; if (inPoint(env->m_x,env->m_y)) env->m_event = ZaEvent::EVENT_CLICK; } }
void ZaObj::eventtest(ZaEvent * event) { ZaObj *p = this; ZaObj *t = this; // ����,��Ч //fprintf(stderr,"ZaObj::eventtest x %d, y %d, w %d,h %d\n", m_x, m_y, m_width,m_height); if ( m_visiable && m_enable && inPoint(event->m_x,event->m_y)) { event->m_obj = this; fprintf(stderr,"ZaObj::eventtest : hit %p \n", this); } if (p->m_visiable && p->m_child) { p = p->m_child; p->eventtest(event); } if (t->m_next) { t = t->m_next; t->eventtest(event); }; }
//----------------------------------------------------------------------------- // Purpose: this function will attempt to remap a key's value // Input : pszKey - the name of the key // pszInvalue - the original value // AllowNameRemapping - only do name remapping if this parameter is true. // this is generally only false on the instance level. // Output : returns true if the value changed // pszOutValue - the new value if changed //----------------------------------------------------------------------------- bool GameData::RemapKeyValue( const char *pszKey, const char *pszInValue, char *pszOutValue, TNameFixup NameFixup ) { if ( RemapOperation.Count() == 0 ) { RemapOperation.SetLessFunc( &CUtlType_LessThan ); RemapOperation.Insert( ivAngle, REMAP_ANGLE ); RemapOperation.Insert( ivTargetDest, REMAP_NAME ); RemapOperation.Insert( ivTargetSrc, REMAP_NAME ); RemapOperation.Insert( ivOrigin, REMAP_POSITION ); RemapOperation.Insert( ivAxis, REMAP_ANGLE ); RemapOperation.Insert( ivAngleNegativePitch, REMAP_ANGLE_NEGATIVE_PITCH ); } if ( !m_InstanceClass ) { return false; } GDinputvariable *KVVar = m_InstanceClass->VarForName( pszKey ); if ( !KVVar ) { return false; } GDIV_TYPE KVType = KVVar->GetType(); int KVRemapIndex = RemapOperation.Find( KVType ); if ( KVRemapIndex == RemapOperation.InvalidIndex() ) { return false; } strcpy( pszOutValue, pszInValue ); switch( RemapOperation[ KVRemapIndex ] ) { case REMAP_NAME: if ( KVType != ivInstanceVariable ) { RemapNameField( pszInValue, pszOutValue, NameFixup ); } break; case REMAP_POSITION: { Vector inPoint( 0.0f, 0.0f, 0.0f ), outPoint; sscanf ( pszInValue, "%f %f %f", &inPoint.x, &inPoint.y, &inPoint.z ); VectorTransform( inPoint, m_InstanceMat, outPoint ); sprintf( pszOutValue, "%g %g %g", outPoint.x, outPoint.y, outPoint.z ); } break; case REMAP_ANGLE: if ( m_InstanceAngle.x != 0.0f || m_InstanceAngle.y != 0.0f || m_InstanceAngle.z != 0.0f ) { QAngle inAngles( 0.0f, 0.0f, 0.0f ), outAngles; matrix3x4_t angToWorld, localMatrix; sscanf ( pszInValue, "%f %f %f", &inAngles.x, &inAngles.y, &inAngles.z ); AngleMatrix( inAngles, angToWorld ); MatrixMultiply( m_InstanceMat, angToWorld, localMatrix ); MatrixAngles( localMatrix, outAngles ); sprintf( pszOutValue, "%g %g %g", outAngles.x, outAngles.y, outAngles.z ); } break; case REMAP_ANGLE_NEGATIVE_PITCH: if ( m_InstanceAngle.x != 0.0f || m_InstanceAngle.y != 0.0f || m_InstanceAngle.z != 0.0f ) { QAngle inAngles( 0.0f, 0.0f, 0.0f ), outAngles; matrix3x4_t angToWorld, localMatrix; sscanf ( pszInValue, "%f", &inAngles.x ); // just the pitch inAngles.x = -inAngles.x; AngleMatrix( inAngles, angToWorld ); MatrixMultiply( m_InstanceMat, angToWorld, localMatrix ); MatrixAngles( localMatrix, outAngles ); sprintf( pszOutValue, "%g", -outAngles.x ); // just the pitch } break; } return ( strcmpi( pszInValue, pszOutValue ) != 0 ); }
void ScallingMousePositionGetter::setMousePosition(double x, double y) { Point inPoint(x,y); Point newPoint = configuration_.getAllegroToBox2dScale().scalePoint(inPoint); rootStateGetter_->setMousePosition(newPoint.getX(), newPoint.getY()); }