Closed allenwong closed 7 years ago
Definitely sounds like a setting this view should support I will add an easier way to do it in 0.8 📦 In the meanwhile heres the line you can change to disable this movement: https://github.com/OrRon/ConfettiView/blob/master/ConfettiView/Classes/ConfettiLayer.swift#L103
Change to:
self.calculatedVelocity = CGPoint(x: self.baseVelocity.x, y: CGFloat(-accelerometerData.acceleration.y*300 / self.depth))
Cheers, Or.
@OrRon Thanks a lot! Looking very much forward to see the new 0.8,
y: CGFloat(-accelerometerData.acceleration.y*300 / self.depth)
It works, but the velocity will be changed when you up and down the phone in vertical direction.
Hopefully it can be designed easily to change velocity and switch on and off the x y z axises.
I checked the awesome source code you written, it based on CMMotionManager. I applied the motion confettiView in my project, the entire effect looks good, but how can I stop the X and Z directions, just only work in Y axis.
Thanks in advance.