motion/joybox/ui/menu_image.rb in joybox-1.0.0 vs motion/joybox/ui/menu_image.rb in joybox-1.1.0

- old
+ new

@@ -1,20 +1,23 @@ module Joybox module UI class MenuImage < CCMenuItemImage + extend Joybox::Common::Initialize + + alias_method :sprite, :normalImage + alias_method :selected_sprite, :selectedImage + alias_method :disabled_sprite, :disabledImage alias_method :content_size, :contentSize - def self.new(options = {}, &block) + def initialize(options = {}, &block) + initWithNormalImage(options[:image_file_name], + selectedImage: options[:selected_image_file_name], + disabledImage: options[:disabled_image_file_name], + block: block) - menu_item = self.itemWithNormalImage(options[:image_file_name], - selectedImage: options[:selected_image_file_name], - block: block) - - menu_item.position = options[:position] if options.has_key? (:position) - - menu_item + self.position = options[:position] if options.has_key? (:position) end end end \ No newline at end of file