Sha256: c608fa5b32b01e9fd5f56e75fd9985f1f9dce6d6e491ef304fd26f480aac589b
Contents?: true
Size: 1.02 KB
Versions: 3
Compression:
Stored size: 1.02 KB
Contents
require 'cf3' ####################################################### # This sketch takes some time to develop, # # clicking the mouse, allows you view current state # # in the final state background will be green # ####################################################### def setup_the_fern @fern = ContextFree.define do shape :start do fern rotation: 8, hue: 306 end shape :fern do square size: 0.75, rotation: -49 split do fern size: 0.92, y: -2, rotation: 5, hue: 306 rewind fern size: 0.5, y: -2, rotation: 90 rewind fern size: 0.5, y: -2, rotation: -90 end end end end def settings size 600, 600 end def setup sketch_title 'Fern' setup_the_fern no_stroke end def draw # Do nothing. end def draw_it background 119, 0.25, 0.2, 1.0 @fern.render :start, size: height/23, color: [126, 0.4, 0.9, 0.55], stop_size: 1, start_x: width/2.5, start_y: height/1.285 end def mouse_clicked draw_it end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
cf3-1.2.0 | samples/fern.rb |
cf3-1.0.1 | samples/fern.rb |
cf3-1.0.0 | samples/fern.rb |