Sha256: 5b04d713bcecf1bc5933722c1aa84b5f960032715455533cda5d3b350c8f4cd9

Contents?: true

Size: 615 Bytes

Versions: 10

Compression:

Stored size: 615 Bytes

Contents

# Words. 
# 
# The text() function is used for writing words to the screen. 

def setup    
  size 640, 360    
  @x = 30 
  PFont::list.each {|fnt| puts fnt} 
  @font = create_font("Georgia", 24)     
  text_font @font, 32    
  no_loop
end

def draw
  background(102)
  text_align(RIGHT)
  draw_type(width * 0.25)
  text_align(CENTER)
  draw_type(width * 0.5)
  text_align(LEFT);
  draw_type(width * 0.75)
end

def draw_type x    
  line(x, 0, x, 65)
  line(x, 220, x, height)   
  fill 0
  text "ichi", x, 95
  fill 51
  text "ni", x, 130
  fill 204
  text "san", x, 165
  fill 255
  text "shi", x, 210    
end

Version data entries

10 entries across 10 versions & 1 rubygems

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