Sha256: bf16ed175100f0aadc93a137ad8bb825ff1dfe6734774bb4836c0a7c87b6ff39

Contents?: true

Size: 801 Bytes

Versions: 2

Compression:

Stored size: 801 Bytes

Contents

module Joybox
  module Configuration

    class Debug

      def self.default_configuration
        {
          repl: false,
          bounding_box: false
        }
      end

      def self.configure(options = {})
        options = options.nil? ? default_configuration : default_configuration.merge!(options)
        options[:repl] = true if options[:bounding_box]

        Object.send(:include, Joybox) if options[:repl] or options[:physics]
        Sprite.send(:include, Joybox::Debug::REPL) if options[:repl]
        Layer.send(:include, Joybox::Debug::Physics) if options.has_key? :physics

        Joybox::Debug::REPL.active = options[:repl]
        Joybox::Debug::REPL.bounding_box = options[:bounding_box]
        Joybox::Debug::Physics.modes = options[:physics]
      end 

    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
joybox-1.1.1 motion/joybox/configuration/debug.rb
joybox-1.1.0 motion/joybox/configuration/debug.rb