Sha256: 1bb53905e27535d0c7688119e2d0e1c104ddba62f9cd2394d3719b679b74dd8d

Contents?: true

Size: 360 Bytes

Versions: 10

Compression:

Stored size: 360 Bytes

Contents

# Redraw. 
# 
# The redraw() function makes draw() execute once.  
# In this example, draw() is executed once every time 
# the mouse is clicked. 


def setup    
  size 200, 200    
  @y = 100    
  stroke 255
  no_loop
end

def draw  
  background 0  	
  @y = @y - 1
  @y = height if @y < 0  	
  line 0, @y, width, @y
end

def mouse_pressed  	
  redraw
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ruby-processing-2.6.3 samples/processing_app/basics/structure/redraw.rb
ruby-processing-2.6.2 samples/processing_app/basics/structure/redraw.rb
ruby-processing-2.6.1 samples/processing_app/basics/structure/redraw.rb
ruby-processing-2.6.0 samples/processing_app/basics/structure/redraw.rb
ruby-processing-2.5.1 samples/processing_app/basics/structure/redraw.rb
ruby-processing-2.5.0 samples/processing_app/basics/structure/redraw.rb
ruby-processing-2.4.4 samples/processing_app/basics/structure/redraw.rb
ruby-processing-2.4.3 samples/processing_app/basics/structure/redraw.rb
ruby-processing-2.4.2 samples/processing_app/basics/structure/redraw.rb
ruby-processing-2.4.1 samples/processing_app/basics/structure/redraw.rb