Sha256: 730ede0f7c94341f667a2a7f58bd4b4ccabfd9be484b86211888a984832d978c

Contents?: true

Size: 634 Bytes

Versions: 10

Compression:

Stored size: 634 Bytes

Contents

#
# Scratch 
# by Andres Colubri. 
# 
# Move the cursor horizontally across the screen to set  
# the position in the movie file.
#
load_library :video
include_package 'processing.video'

attr_reader :mov

def setup
  size(640, 360)
  background(0)  
  @mov = Movie.new(self, "transit.mov")  
  # Pausing the video at the first frame. 
  mov.play
  mov.jump 0
  mov.pause
end

def draw
  begin
    mov.read
    # A new time position is calculated using the current mouse location:
    t = mov.duration * map(mouse_x, 0, width, 0, 1.0)
    mov.play
    mov.jump(t)
    mov.pause 
  end unless !mov.available?
  image(mov, 0, 0)
end



Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ruby-processing-2.6.3 samples/processing_app/library/movie/scratch.rb
ruby-processing-2.6.2 samples/processing_app/library/movie/scratch.rb
ruby-processing-2.6.1 samples/processing_app/library/movie/scratch.rb
ruby-processing-2.6.0 samples/processing_app/library/movie/scratch.rb
ruby-processing-2.5.1 samples/processing_app/library/movie/scratch.rb
ruby-processing-2.5.0 samples/processing_app/library/movie/scratch.rb
ruby-processing-2.4.4 samples/processing_app/library/movie/scratch.rb
ruby-processing-2.4.3 samples/processing_app/library/movie/scratch.rb
ruby-processing-2.4.2 samples/processing_app/library/movie/scratch.rb
ruby-processing-2.4.1 samples/processing_app/library/movie/scratch.rb