def blit( target, pos, src_rect=nil )
unless target.kind_of? Rubygame::Surface
raise TypeError, "blit target must be a Surface"
end
src_x, src_y, src_w, src_h =
case src_rect
when SDL::Rect
[src_rect.x, src_rect.y, src_rect.w, src_rect.h]
when Array
src_rect
when nil
[0, 0] + self.size
end
src_rect = SDL::Rect.new([src_x, src_y, src_w, src_h])
blit_x, blit_y = pos
blit_rect = SDL::Rect.new([blit_x, blit_y, src_w, src_h])
SDL.BlitSurface( @struct, src_rect, target.struct, blit_rect )
return Rubygame::Rect.new( blit_rect.to_ary )
end