/
hello_shapes.rb
69 lines (58 loc) · 1.44 KB
/
hello_shapes.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
require 'glimmer-dsl-jfx'
include Glimmer
window {
title 'Hello, Shapes!'
width 400
height 400
pane {
arc(85, 85, 45, 45, 30, 230) {
type ArcType::OPEN
fill Paint.value_of('#ff0000')
stroke Paint.value_of('#0080ff')
stroke_width 3
}
arc(85, 185, 45, 45, 30, 230) {
type ArcType::CHORD
fill Paint.value_of('#ff0000')
stroke Paint.value_of('#0080ff')
stroke_width 3
}
arc(85, 285, 45, 45, 30, 230) {
type ArcType::ROUND
fill Paint.value_of('#ff0000')
stroke Paint.value_of('#0080ff')
stroke_width 3
}
rectangle(140, 40, 180, 90) {
fill Paint.value_of('#ffff00')
stroke Paint.value_of('#ff0000')
stroke_width 3
}
rectangle(140, 140, 180, 90) {
arc_width 60
arc_height 40
fill Paint.value_of('#ffff00')
stroke Paint.value_of('#ff0000')
stroke_width 3
}
ellipse(230, 285, 90, 45) {
fill Paint.value_of('#ffff00')
stroke Paint.value_of('#ff0000')
stroke_width 3
}
line(180, 60, 280, 110) {
stroke Paint.value_of('#ff0000')
stroke_width 3
}
quad_curve(170, 60, 180, 90, 220, 100) {
fill Paint.value_of('#ffff00')
stroke Paint.value_of('#00ff00')
stroke_width 3
}
cubic_curve(190, 60, 240, 40, 220, 80, 260, 70) {
fill Paint.value_of('#ffff00')
stroke Paint.value_of('#0000ff')
stroke_width 3
}
}
}