[space addBounds:self.view.bounds ....]
Posted: Mon Feb 20, 2012 1:40 am
Hi I'm quite new to chipmunk. I started to follow the Simple Objective-Chipmunk Tutorial this morning. When I changed the button from a UIButton to a UIImageView, the bounds became weird. It was shifted left and down. Moreover, the shift amounts are different according to different image size.
Here's the only part that I changed:
When I tried to change the corner radians of the button, same thing happened again.
Any ideas?
Here's the only part that I changed:
Code: Select all
button = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pig.png"]];
button.backgroundColor = [UIColor blackColor];
button.bounds = CGRectMake(0, 0, SIZE, SIZE);
button.userInteractionEnabled = YES;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(buttonClicked)];
[button addGestureRecognizer:tap];
Any ideas?