I am creating a game where you tap a character when he appears. I have UIImageViews set up with buttons over them is there a way to say that only if the image is being displayed that the button will be pushed?
I am creating a game where you tap a character when he appears. I have UIImageViews set up with buttons over them is there a way to say that only if the image is being displayed that the button will be pushed?
Set a BOOL value so BOOL imageAppeared = NO;
then when the image has appeared set imageAppeared = YES;
then in the IBAtion for the button have at the start
if (imageAppeared) { // so if the imageAppeared is YES Then:
//code to do what ever you want here
}
Not sure quite what you mean,
That method return's yes if it should auto rotate to the orientation specificed (default code will say only vertical), but if you specify orientationLeft then when you rotate it left, it will return yes and rotate it, if you haven't specificed it then when you rotate the phone it will call that method and return no and not change the view in any way
if you want to check which way the phone is position example the home button is at the bottom, on the left, right or up top
then maybe create an NSIntger, and give it a number depending on the direction it is being held, 0 is vertical, 1 is left, 2 is right etc
then just check what that number is when you need to do something if its held in a certain way
as i said not sure quite what you meant so said what the method does, and what i think you may have asked
Sorry for the mix up. I was using that as an example i was asking how do you set up the BOOL like do i say -(BOOL)ImageAppeared; in the .h and say
-(BOOL)ImageAppeared = NO in the .m and so on so forth?
Sorry for the mix up. I was using that as an example i was asking how do you set up the BOOL like do i say -(BOOL)ImageAppeared; in the .h and say
-(BOOL)ImageAppeared = NO in the .m and so on so forth?