- mClippedImage = ClippedImage::Create( imagePath, mClippedImagePropertyIndex );
- mClippedImage.SetSize( mContactCardLayoutInfo.imageSize );
- mClippedImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
- mClippedImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- mClippedImage.SetPosition( mContactCardLayoutInfo.imageFoldedPosition.x, mContactCardLayoutInfo.imageFoldedPosition.y );
- mContactCard.Add( mClippedImage );
+ mClippedImage = ClippedImage::Create(imagePath, mClippedImagePropertyIndex);
+ mClippedImage.SetProperty(Actor::Property::SIZE, mContactCardLayoutInfo.imageSize);
+ mClippedImage.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ mClippedImage.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ mClippedImage.SetProperty(Actor::Property::POSITION, Vector2(mContactCardLayoutInfo.imageFoldedPosition.x, mContactCardLayoutInfo.imageFoldedPosition.y));
+ mClippedImage.SetProperty(Actor::Property::VISIBLE, false); // Hide image as we only want to display it if we are animating or unfolded
+ mContactCard.Add(mClippedImage);
+
+ // Create an image with a mask which is to be used when the contact is folded
+ mMaskedImage = MaskedImage::Create(imagePath);
+ mMaskedImage.SetProperty(Actor::Property::SIZE, mContactCardLayoutInfo.imageSize);
+ mMaskedImage.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+ mMaskedImage.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ mMaskedImage.SetProperty(Actor::Property::POSITION, Vector2(mContactCardLayoutInfo.imageFoldedPosition.x, mContactCardLayoutInfo.imageFoldedPosition.y));
+ mContactCard.Add(mMaskedImage);