-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathhello_drawing_area.rb
84 lines (69 loc) · 1.59 KB
/
hello_drawing_area.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
require 'glimmer-dsl-gtk'
include Glimmer
window {
title 'Hello, Drawing Area!'
default_size 400, 400
drawing_area {
paint 255, 255, 255
arc(85, 85, 45, (Math::PI/180)*90, -(Math::PI/180)*90) {
fill 255, 0, 0
stroke 0, 128, 255
line_width 3
}
arc(85, 185, 45, (Math::PI/180)*100, -(Math::PI/180)*30) {
fill 255, 0, 0
stroke 0, 128, 255
line_width 3
}
circle(85, 285, 45) {
fill 255, 0, 0
stroke 0, 128, 255
line_width 3
}
rectangle(140, 40, 180, 90) {
fill 255, 255, 0
stroke 255, 0, 0
line_width 3
}
rounded_rectangle(140, 140, 180, 90, 30, 20) {
fill 255, 255, 0
stroke 255, 0, 0
line_width 3
}
triangle(140, 240, 320, 240, 230, 330) {
fill 255, 255, 0
stroke 255, 0, 0
line_width 3
}
path {
move_to 160, 100
curve_to 190, 60, 200, 80, 210, 70
curve_to 240, 80, 250, 100, 260, 90
curve_to 290, 90, 300, 110, 310, 100
fill 0, 255, 0
stroke 0, 0, 255
line_width 3
}
path {
move_to 200, 150
line_to 270, 170
line_to 250, 220
line_to 220, 190
line_to 200, 200
line_to 180, 170
close_path
fill 0, 255, 0
stroke 0, 0, 255
line_width 3
}
polygon(200, 260, 270, 270, 250, 290, 220, 290, 200, 280, 180, 270) {
fill 0, 255, 0
stroke 0, 0, 255
line_width 3
}
polyline(270, 320, 250, 340, 220, 340, 200, 330, 180, 320) {
stroke 0, 0, 255
line_width 3
}
}
}.show