8b7d247394e2aaf2260f783e45bc9e6cf7321cc3
[multipass-eu.git] / src / player-drawer-bottom.rb
1 # $Id: player-drawer-bottom.rb 26 2005-06-22 20:19:41Z tilman $
2
3 c = EDJE.collection("euphoria")
4 root = c.part("root")
5 bottom = []
6
7 c.part("player.normal.group.drawer.bottom", :rect) do |p|
8         bottom << p
9
10         p.description do |d|
11                 d.visible = false
12                 d.color = "#00000000"
13
14                 d.rel[0].to = d.rel[1].to = root
15                 d.rel[0].set_offset(45, 0)
16
17                 d.rel[1].set_rel(0.0, 0.0)
18                 d.rel[1].set_offset(226, 177)
19         end
20
21         p.description("visible") do |d|
22                 d.visible = true
23                 d.color = "#00000000"
24         end
25 end
26
27 c.part("player.background.drawer.bottom.shadow", :image) do |p|
28         bottom << p
29
30         p.description do |d|
31                 d.rel[0].to = d.rel[1].to = bottom.first
32                 d.image = "background-drawer-bottom-shadow.png"
33         end
34 end
35
36 c.part("player.background.drawer.bottom.top", :image) do |p|
37         bottom << p
38
39         p.description do |d|
40                 d.rel[0].to = d.rel[1].to = bottom.first
41
42                 d.auto_rel = true
43                 d.image = "background-drawer-bottom-top.png"
44         end
45 end
46
47 c.part("player.background.drawer.bottom.bottom", :image) do |p|
48         bottom << p
49
50         p.description do |d|
51                 d.rel[0].to = d.rel[1].to = bottom.first
52                 d.rel[0].set_offset(0, 37)
53
54                 d.auto_rel = true
55                 d.image = "background-drawer-bottom-bottom.png"
56         end
57 end
58
59 c.part("player.background.drawer.bottom.arm", :image) do |p|
60         bottom << p
61
62         p.description do |d|
63                 d.rel[0].to = d.rel[1].to = bottom.first
64                 d.rel[0].set_offset(64, 0)
65
66                 d.auto_rel = true
67                 d.image = "background-drawer-bottom-arm.png"
68         end
69 end
70
71 c.part("player.background.drawer.bottom.title", :image) do |p|
72         bottom << p
73
74         p.description do |d|
75                 d.rel[0].to = d.rel[1].to = bottom.first
76                 d.rel[0].set_offset(9, 26)
77
78                 d.auto_rel = true
79                 d.image = "background-drawer-bottom-title.png"
80         end
81 end
82
83 h = {"eq" => 9,
84      "options" => 39,
85      "colorthemes" => 94}
86 h.each do |name, (x, im)|
87         bottom << Button.new(c, "player.button." << name, bottom.first,
88                              "button-#{im || name}", x, 151).part
89 end
90
91 c.part("player.background.drawer.bottom.clip", :rect) do |p|
92         p.description do |d|
93                 d.rel[0].to = d.rel[1].to = root
94                 d.rel[0].set_offset(45, 155)
95                 d.rel[1].set_rel(0.0, 0.0)
96                 d.rel[1].set_offset(226, 332)
97         end
98
99         bottom.each { |i| i.clip = p }
100
101         c.part("player.normal.group.drawer.bottom").description("visible") do |d|
102                 d.rel[0].to = d.rel[1].to = p
103         end
104 end
105
106 {"show" => "visible", "hide" => "default"}.each do |prog, state|
107         c.program("player.normal.group.drawer.bottom.#{prog}",
108                   :set_state) do |p|
109                 p.state = state
110                 p.time = 0.5
111                 p.targets <<
112                         ProgramTarget.new(c.part("player.normal.group.drawer.bottom"))
113         end
114 end