MotionInMotion Episode 30 - Animations with CALayer
Animations with CALayer - MotionInMotion
CALayerを使ってflipやshrinkのアニメーション
- UIImageの場合
- image_view.image = UIImage.imageNamed('title')
- @image_layer = image_view.layer
- CALayerの場合
- layer.addSublayer(@image_layer = CALayer.layer)
- def animate(sender)
- if @image_layer.opacity > 0.5
- animation
- @image_layer.transform = CATransform3DMakeRotation(Math::PI/1.5, 1, 0, 0)
- @image_layer.transform = CATransform3DMakeScale(0.5, 0.5, 1.0)
- @image_layer.transform = CATransform3DConcat(
- CATransform3DMakeRotation(Math::PI/1.5, 1, 0, 0),
- CATransform3DMakeScale(0.5, 0.5, 1.0)
- AVPlayerLayer Class Reference
- AVPlayerLayer is a subclass of CALayer