Can we apply gravity behavior to centre of screen?

498 views Asked by At

I am using uidynamicbehavior (UIGravityBehavior) . I played with gravityDirection but could not make it focused on the centre of the screen.

Is there any way around to make the gravity focused in the centre on the screen.

Basically what I want is to show up my views (circles) converged into the centre of the screen even I move them apart.

Any suggestion would be of great help.

EDITED: ADDED CODE

UIGravityBehavior *gravityBehaviour = [[UIGravityBehavior alloc] initWithItems:@[ballView]];

gravityBehaviour.gravityDirection = CGVectorMake(0, -1.0);

we can give gravity direction to move along the line , what if we want to set gravity to act in the centre of the screen. i.e if objects from anywhere getting attracted to the centre of the screen as if center of screen acting like origin of gravity . :)

0

There are 0 answers