Sha256: 652174cbdd01f8494b29bb6b9e6b31719c87571a104d829ff5550a9f153844cc

Contents?: true

Size: 789 Bytes

Versions: 2

Compression:

Stored size: 789 Bytes

Contents

module Joybox
  module Actions
    module D3

      class Wave

        def self.defaults
          {
            duration: 0.3,
            waves: 1,
            amplitude: 10,
            tiled: false
          }
        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)
          klass = options[:tiled] ? CCWavesTiles3D : CCWaves3D
          
          klass.actionWithWaves(options[:waves],
                                amplitude: options[:amplitude],
                                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/wave.rb
joybox-1.1.0 motion/joybox/actions/d3/wave.rb