Example #1
0
void MediaPlayer::setDefaultProperties(){
	mAnimDuration = 0.35f;
	mContentAspectRatio = 1.0;
	mLayoutFixedAspect = true;
	setDefaultBounds(mEngine.getWorldWidth(), mEngine.getWorldHeight());
	setWebViewSize(ci::Vec2f::zero());
	setCacheImages(false);
}
Example #2
0
void EWAUserAction::load( QSettings *pSettings )
{
    if( !pSettings )
    {
        return;
    }
    
    //m_clickedElement.clear();
        
    
    QEvent::Type eType = (QEvent::Type) pSettings->value( QLatin1String( "type" ) ).toInt();
    
    bool bLoaded = false;
    if( isMouseEvent( eType ) )
    {
        m_pEvent = new QMouseEvent( eType
        ,pSettings->value( QLatin1String( "pos" ) ).toPoint()
        ,(Qt::MouseButton)pSettings->value( QLatin1String( "button" ) ).toInt()
        ,(Qt::MouseButtons)pSettings->value( QLatin1String( "buttons" ) ).toInt()
        ,(Qt::KeyboardModifiers)pSettings->value( QLatin1String( "modifiers" ) ).toInt()
        );
        
        /*int nodesCount = pSettings->beginReadArray( "ClickedElement" );
            for( int nodeCounter = 0; nodeCounter < nodesCount; ++nodeCounter )
            {
                pSettings->setArrayIndex( nodeCounter );
                m_clickedElement += pSettings->value( QLatin1String( "node" ), 0 ).toInt();
            }
        pSettings->endArray();*/
        
        bLoaded = true;
    }
    else if( isKeyEvent( eType ) )
    {
        m_pEvent = new QKeyEvent( eType
            ,pSettings->value( QLatin1String( "key" ) ).toInt()
            ,(Qt::KeyboardModifiers)pSettings->value( QLatin1String( "modifiers" ) ).toInt()
            ,pSettings->value( QLatin1String( "text" ) ).toString()
            ,pSettings->value( QLatin1String( "autoRepeat" ) ).toBool()
            ,pSettings->value( QLatin1String( "count" ) ).toInt()
            );
        
        bLoaded = true;
    }
    
    if( bLoaded )
    {
        setTime( pSettings->value( QLatin1String( "delay" ) ).toInt() );
        setWebViewSize( pSettings->value( QLatin1String( "sz" ) ).toSize() );
    }
}