Sha256: 8e4f83d2c2e2189781ffbc58586c5ffdb18298eebe95ee0fef96e79aa5df3715

Contents?: true

Size: 819 Bytes

Versions: 2

Compression:

Stored size: 819 Bytes

Contents

module Joybox
  module Actions
    module D3

      class Lens

        def self.defaults
          {
            duration: 0.3
          }
        end

        def self.with(options = {})
          # Todo print error message on the console
          return unless options.has_key? :grid_size

          options = options.nil? ? defaults : defaults.merge!(options)
          position = options.delete(:position) || [Common::Screen.half_width, Common::Screen.half_height]
          radius = options.delete(:radius) || Common::Screen.half_width
          CCLens3D.actionWithPosition(position,
                                      radius: radius,
                                      grid: options[:grid_size],
                                      duration: options[:duration])
        end

      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
joybox-1.1.1 motion/joybox/actions/d3/lens.rb
joybox-1.1.0 motion/joybox/actions/d3/lens.rb