Sha256: 9e061045a49dc03ddaca70e64918eaa75aabb52cb72fed55ce2e7713159b49d5

Contents?: true

Size: 798 Bytes

Versions: 1

Compression:

Stored size: 798 Bytes

Contents

module Joybox
  module Actions

    class Fade

      def self.defaults
        {
          duration: 0.3,
          opacity: 0
        }
      end

      def self.in(options = {})

        options = options.nil? ? defaults : defaults.merge!(options)

        CCFadeIn.actionWithDuration(options[:duration])
      end

      def self.out(options = {})

        options = options.nil? ? defaults : defaults.merge!(options)

        CCFadeOut.actionWithDuration(options[:duration])
      end

      def self.to(options = {})
        p "========================="
        options = options.nil? ? defaults : defaults.merge!(options)
        p options

        CCFadeTo.actionWithDuration(options[:duration], 
                                    opacity: options[:opacity])
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
joybox-0.0.6 motion/joybox/actions/fade.rb