Created
July 25, 2012 15:48
-
-
Save rcdilorenzo/3176888 to your computer and use it in GitHub Desktop.
Draw Card from Image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)drawFromPosition:(CGPoint)location view:(UIView *)view size:(CGFloat)size { | |
UIImage *cardImage = [UIImage imageNamed:[NSString stringWithFormat:@"%@%@.png", [[self.suit substringToIndex:1] lowercaseString], [[self.rank substringToIndex:1] lowercaseString]]]; | |
UIImageView *cardImageView = [[UIImageView alloc] initWithFrame:CGRectMake(location.x, location.y, cardImage.size.width*size, cardImage.size.height*size)]; | |
[cardImageView setImage:cardImage]; | |
[view addSubview:cardImageView]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment