APSSpriteFrame::APSSpriteFrame ( APSDictionary* pProperties, APSSpriteSheetHolder* pSprietSheetHolder ) 
{
	m_pSpriteFrame		 = KD_NULL;
	m_pSpriteSheetHolder = pSprietSheetHolder;
	m_uFrameIndex		 = 0;

    // Set name
    APSString*  pString = (APSString*) pProperties->getObjectForKey ( this->getNameKey ( ) );
    if ( pString )
	{
        this->setName ( pString->c_str ( ) );
    }
    
    // Set internalName
    pString = (APSString*) pProperties->getObjectForKey ( this->getInternalNameKey ( ) );
    if ( pString ) 
	{
        this->setInternalName ( pString->c_str ( ) );
    }
    
    // Set frameIndex
    APSNumber*  pNumber = (APSNumber*) pProperties->getObjectForKey ( this->getFrameIndexKey ( ) );
    if ( pNumber ) 
	{
        this->setFrameIndex ( pNumber->getUnsignedInteger ( ) );
    }
}
KDbool APSInstantMoveAction::initWithProperties ( APSDictionary* pProperties )
{
    if ( !APSInstantGraphicAction::initWithProperties ( pProperties ) )
	{
        return KD_FALSE;
	}
    
    APSString*  pStr = (APSString*) pProperties->getObjectForKey ( this->getEndPositionKey ( ) );
    if ( pStr )
	{
        this->setEndPosition ( pStr->getPointValue ( ) );
    }

    return KD_TRUE;
}
Example #3
0
bool APSResource::initWithProperties(APSDictionary *properties) {

    // set index
    APSNumber *indexNum = (APSNumber *)properties->getObjectForKey(this->getIndexKey());
    if (indexNum) {
        this->setIndex(APSNumber::indexWithNumber(indexNum));
    }
    
    // set tag
    APSString *tag = (APSString *)properties->getObjectForKey(this->getTagKey());
    if (tag) {
        this->setTag(tag->c_str());
    }
    
    return true;
}
KDbool APSResource::initWithProperties ( APSDictionary* pProperties )
{
    // set index
    APSNumber*  pIndexNum = (APSNumber*) pProperties->getObjectForKey ( this->getIndexKey ( ) );
    if ( pIndexNum )
	{
        this->setIndex ( APSNumber::indexWithNumber ( pIndexNum ) );
    }
    
    // set tag
    APSString*  pTag = (APSString*) pProperties->getObjectForKey ( this->getTagKey ( ) );
    if ( pTag )
	{
        this->setTag ( pTag->c_str ( ) );
    }
    
    return KD_TRUE;
}
KDbool APSMedium::initWithProperties ( APSDictionary* pProperties )
{    
    // Set code
    APSString*  pString = (APSString*) pProperties->getObjectForKey ( this->getCodeKey ( ) );
    if ( pString ) 
	{
        this->setCode ( pString->c_str ( ) );
    }

    // Set filename
    pString = (APSString*) pProperties->getObjectForKey ( this->getFilenameKey ( ) );
    if ( pString )
	{
        this->setFilename ( pString->c_str ( ) );
    }
    
    return true;
}
Example #6
0
bool APSSprite::initWithProperties(APSDictionary *properties) {
    bool ok = APSGraphic::initWithProperties(properties);
    
    APSNumber *number;
    
    // set isAnimatable
    number = (APSNumber *)properties->getObjectForKey(this->getIsAnimatableKey());
    if (number) {
        this->setIsAnimatable(number->getBoolean());
    }
    
    // set flipX
    number = (APSNumber *)properties->getObjectForKey(this->getFlipXKey());
    if (number) {
        this->setFlipX(number->getBoolean());
    }
    
    // set flipY
    number = (APSNumber *)properties->getObjectForKey(this->getFlipYKey());
    if (number) {
        this->setFlipY(number->getBoolean());
    }
    
    // set imageHolderCode
    APSString *str = (APSString *)properties->getObjectForKey(this->getImageHolderCodeKey());
    if (str) {
        this->setImageHolderCode(str->c_str());
    }
    
    /*
    // set originalFrame
    number = (APSNumber *)properties->getObjectForKey(kAPSSprite_originalFrameKey);
    if (number) {
        this->setOriginalFrame(number->getUnsignedInteger());
    }
    */
    
    return ok;
}
Example #7
0
bool APSScaleAction::initWithProperties(APSDictionary *properties) {
    bool ok = APSIntervalGraphicAction::initWithProperties(properties);
    
    // set endScale
    APSString *str = (APSString *)properties->getObjectForKey(this->getEndScaleKey());
    if (str) {
        this->m_endScale = str->getPointValue();
    }

    /*
     v1.0.1
    APSNumber *number = (APSNumber *)properties->getObjectForKey(kAPSScaleAction_endScaleXKey);
    if (number) {
        this->m_endScale.x = number->getFloat();
    }
    
    number = (APSNumber *)properties->getObjectForKey(kAPSScaleAction_endScaleYKey);
    if (number) {
        this->m_endScale.y = number->getFloat();
    }
    */
    return ok;
    
}