I'm creating Poker game. So initially I'm showing back face of playing cards and then I need to add flip animation on the cards to show the value of cards. I've searched the net but I didn't find anything that could have helped me. my code is as follows.
void LoadBacksideOfCards()
{
player1Card1.SetImageResource(Resource.Drawable.backside);
player1Card2.SetImageResource(Resource.Drawable.backside);
player2Card1.SetImageResource(Resource.Drawable.backside);
player2Card2.SetImageResource(Resource.Drawable.backside);
player3Card1.SetImageResource(Resource.Drawable.backside);
player3Card2.SetImageResource(Resource.Drawable.backside);
player4Card1.SetImageResource(Resource.Drawable.backside);
player4Card2.SetImageResource(Resource.Drawable.backside);
centerCard1.SetImageResource(Resource.Drawable.backside);
centerCard2.SetImageResource(Resource.Drawable.backside);
centerCard3.SetImageResource(Resource.Drawable.backside);
centerCard4.SetImageResource(Resource.Drawable.backside);
centerCard5.SetImageResource(Resource.Drawable.backside);
}
And showing the cards using following code
void ShowCenterCardNumber(int cardNumber)
{
if (cardNumber == 3)
{
centerCard4.SetImageResource(DrawableImageMap[_shuffledCardsData.CenterCardsData[3].CardNumber + _shuffledCardsData.CenterCardsData[3].CardType]);
}
else
{
centerCard5.SetImageResource(DrawableImageMap[_shuffledCardsData.CenterCardsData[4].CardNumber + _shuffledCardsData.CenterCardsData[4].CardType]);
}
}
void ShowFirstThreeCenterCards()
{
centerCard1.SetImageResource(DrawableImageMap[_shuffledCardsData.CenterCardsData[0].CardNumber + _shuffledCardsData.CenterCardsData[0].CardType]);
centerCard2.SetImageResource(DrawableImageMap[_shuffledCardsData.CenterCardsData[1].CardNumber + _shuffledCardsData.CenterCardsData[1].CardType]);
centerCard3.SetImageResource(DrawableImageMap[_shuffledCardsData.CenterCardsData[2].CardNumber + _shuffledCardsData.CenterCardsData[2].CardType]);
}
I want to add some flip functionality to make it more interactive to users. I'm using simple XML (without MONO Games). any help in this regard will be much appreciated.
A few suggestions: http://developer.android.com/training/animation/cardflip.html http://2cupsoftech.wordpress.com/2012/09/18/3d-flip-between-two-view-or-viewgroup-on-android/ Android flip image animation https://github.com/castorflex/FlipImageView