def set_frame
      frames = @animations[@playing_animation]
      case frames
      when Range
        reset_clipping_rect
        @clip_x = @current_frame * @clip_width
      when Array
        f = frames[@current_frame]
        @clip_x      = f[:x]      || @defaults[:clip_x]
        @clip_y      = f[:y]      || @defaults[:clip_y]
        @clip_width  = f[:width]  || @defaults[:clip_width]
        @clip_height = f[:height] || @defaults[:clip_height]
        @frame_time  = f[:time]   || @defaults[:frame_time]
      end
    end
def set_frame
      frames = @animations[@playing_animation]
      case frames
      when Range
        reset_clipping_rect
        @clip_x = @current_frame * @clip_width
      when Array
        f = frames[@current_frame]
        @clip_x      = f[:x]      || @defaults[:clip_x]
        @clip_y      = f[:y]      || @defaults[:clip_y]
        @clip_width  = f[:width]  || @defaults[:clip_width]
        @clip_height = f[:height] || @defaults[:clip_height]
        @frame_time  = f[:time]   || @defaults[:frame_time]
      end
    end
def set_frame frames = @animations [ @playing_animation ] case frames when Range reset_clipping_rect @clip_x = @current_frame * @clip_width when Array f = frames [ @current_frame ] @clip_x = f [ :x ] || @defaults [ :clip_x ] @clip_y = f [ :y ] || @defaults [ :clip_y ] @clip_width = f [ :width ] || @defaults [ :clip_width ] @clip_height = f [ :height ] || @defaults [ :clip_height ] @frame_time = f [ :time ] || @defaults [ :frame_time ] end end
Set the position of the clipping retangle based on the current frame
Set the position of the clipping retangle based on the current frame