August 22, 2010

codes for touch in iphone

Every user should control game easily. Game controlling can be doing with  keypress
or touch or device(in iphone and some device).Which one you like?In iphone or even
java you should use events for every user command .In  this article we  focused on
touch events and codes.

a touch can be occurred in interface that i discussed in previous article. For any touch
and interface you should define function and connection from interface to function.
if you want use button button have many touch event like touch cancel,touch
down,touch up inside and etc.With right click in button in mainwindow you’ll see
events, select one of them and connected it to window select function you create for 
button.like this image


For other part of windows you shoul add more code .A code like it can be use
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
}
with this code you can define point for your touch .
CGPoint  lastPoint;
and in part of program that you can use it for detect your finger.
CGPoint gamePoint = [touch locationInView:self.view];
you can get coordinates of point.
x=gamePoint.x;y=gamePoint.y
in next post we discussed detailed about game making and also i’ll add more source code.

7 comments:

Isha Shiri said...

Hello, thank you for follow me. Here you give interesting tips!

Very good work, cool.

Unknown said...

@isha thanks for your comment also

kelly world news said...

very good tips, following you now

Unknown said...

@kelly thanks for follow me,i followed you too

@bujju i visit your blog and followed your blog also

Unknown said...

@bujju thanks for your comment

website hostings said...

Above the topic in new one for me. I learned some new things through your blog. It's simple and excellent topic.

fishfinderkit said...

ketogenic diet book Weeks to Excess weight Loss Exercise ProgramExercise, Tips, and Motivation to Slim DownLooking for an exercise program that's perfect for a beginning exerciser? Need a step-by-step guide to help you lose weight? This 12-week plan gives you all the tools you need.You'll get Cardio , strength training and flexibility workoutsWeekly calendars to organize your workouts Quick suggestions to assist you to stay on trackscheduled program is easy, but it doesn't mean it's easy. Like any 12-week weightloss program just, you should have ups and downs. It is critical to anticipate those fluctuations beforehand. Some weeks you'll do great, and others you won't. That's normal. Be sure to listen to your own body and do what's right for you. Every workout listed is usually a suggestion. Substitute similar workouts if you like. You can always walk, go for a bike trip, hike with a good friend, or take your children to the recreation area for a casino game of tag or Frisbee to get some good activity too.
http://www.cureidea.com/keto-fuel-diet/