Method: TkGoldberg_Demo#draw10

Defined in:
sample/demos-en/goldberg.rb,
sample/demos-jp/goldberg.rb

#draw10Object

Boat



957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
# File 'sample/demos-en/goldberg.rb', line 957

def draw10
  color  = @C['10a']
  color2 = @C['10b']
  xy = [191, 230, 233, 230, 233, 178, 191, 178]  # Sail
  TkcPolygon.new(@canvas, xy, :fill=>color, :width=>3, :outline=>@C['fg'],
                 :tag=>'I10')
  xy = box(209, 204, 31)  # Front
  TkcArc.new(@canvas, xy, :outline=>'', :fill=>color, :style=>:pie,
             :start=>120, :extent=>120, :tag=>'I10')
  TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc,
             :start=>120, :extent=>120, :tag=>'I10')
  xy = box(249, 204, 31)  # Back
  TkcArc.new(@canvas, xy, :outline=>'', :fill=>@C['bg'], :width=>3,
             :style=>:pie, :start=>120, :extent=>120, :tag=>'I10')
  TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc,
             :start=>120, :extent=>120, :tag=>'I10')

  xy = [200, 171, 200, 249]  # Mast
  TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I10')
  xy = [159, 234, 182, 234]  # Bow sprit
  TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3, :tag=>'I10')
  xy = [180, 234, 180, 251, 220, 251]  # Hull
  TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>6, :tag=>'I10')

  xy = [92, 255, 221, 255]  # Waves
  sine(xy, 2, 25, :fill=>color2, :width=>1, :tag=>'I10w')

  xy = @canvas.coords('I10w')[4..-5]  # Water
  xy.concat([222, 266, 222, 277, 99, 277])
  TkcPolygon.new(@canvas, xy, :fill=>color2, :outline=>color2)
  xy = [222, 266, 222, 277, 97, 277, 97, 266]  # Water bottom
  TkcLine.new(@canvas, xy, :fill=>@C['fg'], :width=>3)

  xy = box(239, 262, 17)
  TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc,
             :start=>95, :extent=>103)
  xy = box(76, 266, 21)
  TkcArc.new(@canvas, xy, :outline=>@C['fg'], :width=>3, :style=>:arc,
             :extent=>190)
end