class Teacup::TransformLayer

Public Instance Methods

flip(angle) click to toggle source

rotates the “up & down” direction. The bottom of the view will rotate towards the user as angle increases.

# File lib/teacup/stylesheet_extensions/transform.rb, line 52
def flip(angle)
  CATransform3DRotate(identity, angle, 1, 0, 0)
end
identity() click to toggle source
# File lib/teacup/stylesheet_extensions/transform.rb, line 46
def identity
  [1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1]
end
rotate(angle, x, y, z) click to toggle source

rotates the layer arbitrarily

# File lib/teacup/stylesheet_extensions/transform.rb, line 69
def rotate(angle, x, y, z)
  CATransform3DRotate(identity, angle, x, y, z)
end
spin(angle) click to toggle source

spins, along the z axis. This is probably the one you want, for “spinning” a view like you might a drink coaster or paper napkin.

# File lib/teacup/stylesheet_extensions/transform.rb, line 64
def spin(angle)
  CATransform3DRotate(identity, angle, 0, 0, 1)
end
twist(angle) click to toggle source

rotates the “left & right” direction. The right side of the view will rotate towards the user as angle increases.

# File lib/teacup/stylesheet_extensions/transform.rb, line 58
def twist(angle)
  CATransform3DRotate(identity, angle, 0, 1, 0)
end