Fixed fontdir handling.
[redact.git] / test / crossfade.rb
1 # $Id: crossfade.rb 24 2005-04-09 13:53:14Z tilman $
2
3 include Redact
4
5 EDJE.collection("crossfade") do |c|
6         c.part("background", :rect).description do |d|
7                 d.color = "#ffffff"
8         end
9
10         c.part("rect_red", :rect) do |p|
11                 p.description do |d|
12                         d.color = "#00ff0000"
13                         d.rel[1].set_rel(1.0, 0.0)
14                 end
15
16                 p.description("default", 1.0) do |d|
17                         d.color = "#ff"
18                         d.rel[1].set_rel(1.0, 0.4)
19                 end
20         end
21
22         c.part("rect_green", :rect) do |p|
23                 p.description do |d|
24                         d.color = "#ff000080"
25                         d.rel[0].set_rel(0.0, 1.0)
26                 end
27
28                 p.description("default", 1.0) do |d|
29                         d.color = "#00ff"
30                         d.rel[0].set_rel(0.0, 0.6)
31                 end
32         end
33
34         c.part("text", :text) do |p|
35                 p.description do |d|
36                         d.color = "#00"
37
38                         d.text = "cuddletech"
39                         d.font = "Vera"
40                         d.font_size = 12
41                         d.set_fit(true, false)
42                 end
43         end
44
45         c.program("animate", :set_state) do |p|
46                 p.signal = "mouse,clicked,1"
47                 p.source = "background"
48                 p.value = 1.0
49                 p.mode = :accelerate
50                 p.time = 1.0
51                 p.targets << ProgramTarget.new(c.part("rect_red"))
52                 p.targets << ProgramTarget.new(c.part("rect_green"))
53         end
54 end