Class: Array

Inherits:
Object show all
Includes:
Miyako::SpriteArray
Defined in:
lib/Miyako/API/color.rb,
lib/Miyako/API/modules.rb

Instance Method Summary collapse

Methods included from Miyako::SpriteArray

#deep_copy, #move!, #move_to!, #render, #render_d, #render_to, #render_xy, #render_xy_to, #reset, #sprite_only, #sprite_only!, #start, #stop, #swap, #update_animation, #visible, #visible=

Methods included from Miyako::Animation

[], []=, anim_hash, #reset, reset, start, #start, #stop, stop, update, update_animation, #update_animation

Methods included from Miyako::SpriteBase

#bitmap, #hide, #image_rect, #image_size, #oh, #oh=, #ow, #ow=, #ox, #ox=, #oy, #oy=, #part_rect, #rect, #render, #render_d, #render_to, #render_xy, #render_xy_to, #show, #to_sprite, #to_unit, #update, #visible, #visible=

Instance Method Details

#deep_dupObject

複製を取得する

ただし、配列の要素もdeep_dupメソッドで複製する

返却値

複写したインスタンスを返す


520
521
522
# File 'lib/Miyako/API/modules.rb', line 520

def deep_dup
  self.dup.map{|e| (e && e.methods.include?(:deep_dup)) ? e.deep_dup : e }
end

#to_miyako_colorObject

:nodoc:


172
173
174
175
176
# File 'lib/Miyako/API/color.rb', line 172

def to_miyako_color #:nodoc:
  raise Miyako::MiyakoError, "Color Array needs more than 3 elements : #{self.length} elements" if self.length < 3
  return (self[0,3] << 255) if self.length == 3
  return self[0,4]
end