OK so pretty much this accelerometer code works, but whenever it hits the corner of the screen it gets stuck. The only way to unstick it is to tilt the screen more than necessary. Please help. Here is the code..
OK so pretty much this accelerometer code works, but whenever it hits the corner of the screen it gets stuck. The only way to unstick it is to tilt the screen more than necessary. Please help. Here is the code..
play with the definition of capital letter "X" and "Y". Try changing the number "50"
You can also play around with the update interval.
This....just off the top of my head...no guarantees
Thanks I will play around with the X and Y. Also sorry for all the questions but is it possible to put the moving object (accelerometer object) into a animation?
Thanks I will play around with the X and Y. Also sorry for all the questions but is it possible to put the moving object (accelerometer object) into a animation?
Thanks
I've never done that...but have created scenes where objects are moving and the accelerometer controls the motion of the objects. There was additional animation in the scene.
If you mean UIView Animation...I've superimposed two UIView animations...so assume you could probably do the same using the accelerometer.
A lot of this sort of thing is just putting one inside the other....
Write code snippets of the special effects that you visualize...keep them isolated in a project for each special effect. Then when you have it finetuned, transfer it over to your main project.
IE...play with it. And use your instincts as to what feels and looks right.
I've never done that...but have created scenes where objects are moving and the accelerometer controls the motion of the objects. There was additional animation in the scene.
If you mean UIView Animation...I've superimposed two UIView animations...so assume you could probably do the same using the accelerometer.
A lot of this sort of thing is just putting one inside the other....
Write code snippets of the special effects that you visualize...keep them isolated in a project for each special effect. Then when you have it finetuned, transfer it over to your main project.
IE...play with it. And use your instincts as to what feels and looks right.
Maybe it isnt a UiView Animation... What I am trying to acheive is when a moving UIImage (1st UIView animation) comes under the accelerometer image I want it to move with the UIImage (1st Animation). Would this be a UIView animation I am trying to acheive?
Maybe it isnt a UiView Animation... What I am trying to acheive is when a moving UIImage (1st UIView animation) comes under the accelerometer image I want it to move with the UIImage (1st Animation). Would this be a UIView animation I am trying to acheive?
When the accelerated view intersects with the first animated view, feed them both the same coordinates continually. Use an IF statement to do the branch off. Test for intersection and then if satisfied, branch off one and give it the same coordinates as the other.
That's how I would do it. Coding it though is something I'd have to play around with. I would create a barebones project with just two objects and code it for only that.
When the accelerated view intersects with the first animated view, feed them both the same coordinates continually. Use an IF statement to do the branch off. Test for intersection and then if satisfied, branch off one and give it the same coordinates as the other.
That's how I would do it. Coding it though is something I'd have to play around with. I would create a barebones project with just two objects and code it for only that.
Good idea, can I do it by CGIntersectsrect?
Also I want the accelerometer image to be on top of the Quartz Animation Image, so how would I do that, I dont want the accelerometer image to be in the Quartz Image
Also I want the accelerometer image to be on top of the Quartz Animation Image, so how would I do that, I dont want the accelerometer image to be in the Quartz Image
Yes, you can do that.
If you put it accelerometer image inside a UIImageView, it will generally be on top of the drawn image.
If both are drawn, then you've another problem that you'll have to code for. I assume you can use layers to draw one object on each layer and then determine which layer you want to be the top layer.
Last edited by Not_Appy_At_All; 10-23-2010 at 07:37 PM.
If you put it accelerometer image inside a UIImageView, it will always be on top of the drawn image.
If both are drawn, then you've another problem that you'll have to code for. I assume you can use layers to draw one object on each layer and then determine which layer you want to be the top layer.
Alright let me work on that, ill get back to you within the hour
If you don't mind using the iOS 4 SDK, Core Motion is something I'd recommend looking into. It makes motion based control a lot better on the iphone 4.
If you don't mind using the iOS 4 SDK, Core Motion is something I'd recommend looking into. It makes motion based control a lot better on the iphone 4.
I dont want to get into Core Motion, it is too new and there is not enough info about it.
But I have a problem still regarding the accelrometer. If someone doesnt mind testing it out on their device, but the accelerometer image is still sticking to the side a little bit. Also I am not sure why but whenever I touch the screen anywhere the image is like following my finger when it shouldnt be. Please help me figure this out and ill post a tutorial on this and will shout out your names maybe even give a donation
I dont want to get into Core Motion, it is too new and there is not enough info about it.
But I have a problem still regarding the accelrometer. If someone doesnt mind testing it out on their device, but the accelerometer image is still sticking to the side a little bit. Also I am not sure why but whenever I touch the screen anywhere the image is like following my finger when it shouldnt be. Please help me figure this out and ill post a tutorial on this and will shout out your names maybe even give a donation