PDA

View Full Version : Temporarily Spawning UIImageView




Narcs
Jan 28, 2012, 09:00 PM
I have a UIImageView called hitBox. And an IBAction called hit. What I want to do is temporarily spawn the hitBox UIImageView hitBox for a fractions of a second.

-(IBAction)hit{
here is where i temporarily want to spawn hitBox
}

Thanks :)



robvas
Jan 28, 2012, 09:11 PM
Well, you could add a new one by doing something like:

UIImageView *hitbox = [[UIImageView alloc] initWithImage:hitboxImage];
[self.view addSubview:hitbox];
[hitbox setFrame:CGRectMake(x,y,hitboxHorizSize, hitboxVertSize)];