Sha256: 96931c9cea47569e48acef701d62a0b0af0a1aeb4f1b596bb0310852ceb379af

Contents?: true

Size: 569 Bytes

Versions: 2

Compression:

Stored size: 569 Bytes

Contents

module Joybox
  module Actions

    class Move

      def self.defaults
        {
          duration: 0.3,
          position: [0, 0]
        }
      end

      def self.by(options = {})
        options = options.nil? ? defaults : defaults.merge!(options)
        CCMoveBy.actionWithDuration(options[:duration], position: options[:position])
      end

      def self.to(options = {})
        options = options.nil? ? defaults : defaults.merge!(options)
        CCMoveTo.actionWithDuration(options[:duration], position: options[:position])
      end

    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
joybox-1.1.1 motion/joybox/actions/move.rb
joybox-1.1.0 motion/joybox/actions/move.rb