limelight 0.0.1-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. data/bin/icons/icon.ico +0 -0
  2. data/bin/icons/icon_48.gif +0 -0
  3. data/bin/icons/limelight.icns +0 -0
  4. data/bin/icons/splash.png +0 -0
  5. data/bin/limelight +6 -0
  6. data/bin/ll +10 -0
  7. data/bin/ll.bat +5 -0
  8. data/lib/init.rb +11 -0
  9. data/lib/limelight/build_exception.rb +45 -0
  10. data/lib/limelight/button_group_cache.rb +11 -0
  11. data/lib/limelight/casting_director.rb +72 -0
  12. data/lib/limelight/commands.rb +66 -0
  13. data/lib/limelight/file_chooser.rb +55 -0
  14. data/lib/limelight/file_filter.rb +26 -0
  15. data/lib/limelight/java_util.rb +29 -0
  16. data/lib/limelight/limelight_exception.rb +9 -0
  17. data/lib/limelight/loaders/file_scene_loader.rb +48 -0
  18. data/lib/limelight/menu_bar.rb +49 -0
  19. data/lib/limelight/paint_action.rb +25 -0
  20. data/lib/limelight/pen.rb +53 -0
  21. data/lib/limelight/players/button.rb +29 -0
  22. data/lib/limelight/players/check_box.rb +38 -0
  23. data/lib/limelight/players/combo_box.rb +44 -0
  24. data/lib/limelight/players/radio_button.rb +47 -0
  25. data/lib/limelight/players/text_area.rb +25 -0
  26. data/lib/limelight/players/text_box.rb +25 -0
  27. data/lib/limelight/players.rb +9 -0
  28. data/lib/limelight/producer.rb +141 -0
  29. data/lib/limelight/production.rb +64 -0
  30. data/lib/limelight/production_builder.rb +49 -0
  31. data/lib/limelight/prop.rb +241 -0
  32. data/lib/limelight/prop_builder.rb +60 -0
  33. data/lib/limelight/scene.rb +75 -0
  34. data/lib/limelight/stage.rb +93 -0
  35. data/lib/limelight/stage_builder.rb +62 -0
  36. data/lib/limelight/styles.rb +37 -0
  37. data/lib/limelight/styles_builder.rb +61 -0
  38. data/lib/limelight/theater.rb +42 -0
  39. data/lib/limelight/util.rb +26 -0
  40. data/lib/limelight/version.rb +20 -0
  41. data/lib/limelight.jar +0 -0
  42. data/productions/examples/8thlight.com/about/about.txt +24 -0
  43. data/productions/examples/8thlight.com/about/props.rb +11 -0
  44. data/productions/examples/8thlight.com/about/styles.rb +2 -0
  45. data/productions/examples/8thlight.com/footer.rb +6 -0
  46. data/productions/examples/8thlight.com/home/props.rb +28 -0
  47. data/productions/examples/8thlight.com/home/styles.rb +2 -0
  48. data/productions/examples/8thlight.com/images/anvil.jpg +0 -0
  49. data/productions/examples/8thlight.com/images/bg.jpg +0 -0
  50. data/productions/examples/8thlight.com/images/botticelli.jpg +0 -0
  51. data/productions/examples/8thlight.com/images/button_bg.jpg +0 -0
  52. data/productions/examples/8thlight.com/images/canvas_bg.jpg +0 -0
  53. data/productions/examples/8thlight.com/images/footer_bg.jpg +0 -0
  54. data/productions/examples/8thlight.com/images/header.jpg +0 -0
  55. data/productions/examples/8thlight.com/images/moses.jpg +0 -0
  56. data/productions/examples/8thlight.com/images/statemachine_thumbnail.png +0 -0
  57. data/productions/examples/8thlight.com/images/thumbnail_book.jpg +0 -0
  58. data/productions/examples/8thlight.com/menu.rb +11 -0
  59. data/productions/examples/8thlight.com/services/props.rb +11 -0
  60. data/productions/examples/8thlight.com/services/services.txt +8 -0
  61. data/productions/examples/8thlight.com/services/styles.rb +2 -0
  62. data/productions/examples/8thlight.com/stages.rb +8 -0
  63. data/productions/examples/8thlight.com/styles.rb +205 -0
  64. data/productions/examples/calculator/players/button.rb +24 -0
  65. data/productions/examples/calculator/players/calculator.rb +15 -0
  66. data/productions/examples/calculator/players/calculator_model.rb +13 -0
  67. data/productions/examples/calculator/props.rb +23 -0
  68. data/productions/examples/calculator/styles.rb +38 -0
  69. data/productions/examples/langstons_ant/html_javascript/ant.css +39 -0
  70. data/productions/examples/langstons_ant/html_javascript/ant.html +22 -0
  71. data/productions/examples/langstons_ant/html_javascript/ant.js +23 -0
  72. data/productions/examples/langstons_ant/players/ant.rb +103 -0
  73. data/productions/examples/langstons_ant/players/log.rb +29 -0
  74. data/productions/examples/langstons_ant/players/start_stop_button.rb +37 -0
  75. data/productions/examples/langstons_ant/players/world.rb +61 -0
  76. data/productions/examples/langstons_ant/props.rb +22 -0
  77. data/productions/examples/langstons_ant/styles.rb +105 -0
  78. data/productions/examples/sandbox/click_me/players/chromaton.rb +47 -0
  79. data/productions/examples/sandbox/click_me/props.rb +8 -0
  80. data/productions/examples/sandbox/click_me/styles.rb +12 -0
  81. data/productions/examples/sandbox/floaters/players/floater.rb +92 -0
  82. data/productions/examples/sandbox/floaters/players/surface.rb +17 -0
  83. data/productions/examples/sandbox/floaters/props.rb +10 -0
  84. data/productions/examples/sandbox/floaters/styles.rb +25 -0
  85. data/productions/examples/sandbox/gradients/players/spinner.rb +23 -0
  86. data/productions/examples/sandbox/gradients/players/teaser.rb +26 -0
  87. data/productions/examples/sandbox/gradients/players/wave.rb +26 -0
  88. data/productions/examples/sandbox/gradients/players/waves.rb +26 -0
  89. data/productions/examples/sandbox/gradients/props.rb +13 -0
  90. data/productions/examples/sandbox/gradients/styles.rb +47 -0
  91. data/productions/examples/sandbox/header.rb +15 -0
  92. data/productions/examples/sandbox/homer/players/homer.rb +20 -0
  93. data/productions/examples/sandbox/homer/props.rb +10 -0
  94. data/productions/examples/sandbox/homer/styles.rb +17 -0
  95. data/productions/examples/sandbox/images/arch.jpg +0 -0
  96. data/productions/examples/sandbox/images/beach.jpg +0 -0
  97. data/productions/examples/sandbox/images/homer.jpg +0 -0
  98. data/productions/examples/sandbox/images/limelight_spotlight.jpg +0 -0
  99. data/productions/examples/sandbox/images/marilyn.jpg +0 -0
  100. data/productions/examples/sandbox/inputs/players/button_input.rb +48 -0
  101. data/productions/examples/sandbox/inputs/players/check_box_input.rb +40 -0
  102. data/productions/examples/sandbox/inputs/players/combo_box_input.rb +41 -0
  103. data/productions/examples/sandbox/inputs/players/radio_button_input.rb +43 -0
  104. data/productions/examples/sandbox/inputs/players/text_area_input.rb +36 -0
  105. data/productions/examples/sandbox/inputs/players/text_box_input.rb +36 -0
  106. data/productions/examples/sandbox/inputs/props.rb +40 -0
  107. data/productions/examples/sandbox/inputs/styles.rb +39 -0
  108. data/productions/examples/sandbox/players/sandbox.rb +11 -0
  109. data/productions/examples/sandbox/rounded_corners/players/box.rb +11 -0
  110. data/productions/examples/sandbox/rounded_corners/props.rb +22 -0
  111. data/productions/examples/sandbox/rounded_corners/styles.rb +18 -0
  112. data/productions/examples/sandbox/scrolling/players/cell.rb +16 -0
  113. data/productions/examples/sandbox/scrolling/props.rb +40 -0
  114. data/productions/examples/sandbox/scrolling/styles.rb +25 -0
  115. data/productions/examples/sandbox/sketching/players/sketchpad.rb +46 -0
  116. data/productions/examples/sandbox/sketching/props.rb +25 -0
  117. data/productions/examples/sandbox/sketching/styles.rb +36 -0
  118. data/productions/examples/sandbox/stages.rb +6 -0
  119. data/productions/examples/sandbox/styles.rb +37 -0
  120. data/productions/examples/sandbox/teaser/players/fader.rb +58 -0
  121. data/productions/examples/sandbox/teaser/props.rb +14 -0
  122. data/productions/examples/sandbox/teaser/styles.rb +22 -0
  123. data/productions/examples/tutorials/tutorial_1/players/sample.rb +11 -0
  124. data/productions/examples/tutorials/tutorial_1/props.rb +9 -0
  125. data/productions/examples/tutorials/tutorial_1/styles.rb +27 -0
  126. data/productions/stage_composer/init.rb +10 -0
  127. data/productions/stage_composer/inspector/players/inspector.rb +80 -0
  128. data/productions/stage_composer/inspector/players/prop_row.rb +12 -0
  129. data/productions/stage_composer/inspector/players/prop_tree.rb +33 -0
  130. data/productions/stage_composer/inspector/players/style_table.rb +12 -0
  131. data/productions/stage_composer/inspector/players/style_value.rb +16 -0
  132. data/productions/stage_composer/inspector/props.rb +19 -0
  133. data/productions/stage_composer/inspector/styles.rb +71 -0
  134. data/productions/stage_composer/lib/init.rb +5 -0
  135. data/productions/stage_composer/lib/limelight/composer/controller.rb +51 -0
  136. data/productions/stage_composer/lib/limelight/composer/lethargy.rb +24 -0
  137. data/productions/stage_composer/production.rb +6 -0
  138. data/productions/stage_composer/stages.rb +15 -0
  139. data/productions/startup/props.rb +5 -0
  140. data/spec/casting_director_spec.rb +94 -0
  141. data/spec/commands_spec.rb +33 -0
  142. data/spec/file_chooser_spec.rb +64 -0
  143. data/spec/file_filter_spec.rb +29 -0
  144. data/spec/java_util_spec.rb +53 -0
  145. data/spec/loaders/file_loader_spec.rb +28 -0
  146. data/spec/paint_action_spec.rb +30 -0
  147. data/spec/pen_spec.rb +62 -0
  148. data/spec/players/button_spec.rb +31 -0
  149. data/spec/players/check_box_spec.rb +40 -0
  150. data/spec/players/combo_box_spec.rb +39 -0
  151. data/spec/players/radio_button_spec.rb +75 -0
  152. data/spec/players/text_area_spec.rb +37 -0
  153. data/spec/players/text_box_spec.rb +37 -0
  154. data/spec/producer_spec.rb +157 -0
  155. data/spec/production_builder_spec.rb +48 -0
  156. data/spec/production_spec.rb +75 -0
  157. data/spec/prop_builder_spec.rb +178 -0
  158. data/spec/prop_spec.rb +216 -0
  159. data/spec/scene_spec.rb +34 -0
  160. data/spec/spec_helper.rb +18 -0
  161. data/spec/stage_builder_spec.rb +90 -0
  162. data/spec/stage_spec.rb +57 -0
  163. data/spec/styles_builder_spec.rb +123 -0
  164. data/spec/theater_spec.rb +66 -0
  165. metadata +275 -0
@@ -0,0 +1,105 @@
1
+ #- Copyright 2008 8th Light, Inc.
2
+ #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
+
4
+ earth {
5
+ width 900
6
+ height 900
7
+ background_color "blue"
8
+ gradient :on
9
+ secondary_background_color "#88f"
10
+ gradient_angle 310
11
+ gradient_penetration 75
12
+ horizontal_alignment "center"
13
+ }
14
+
15
+ title {
16
+ width "100%"
17
+ height 100
18
+ border_width 2
19
+ border_color "orange"
20
+ margin 10
21
+ vertical_alignment "center"
22
+ horizontal_alignment "center"
23
+ text_color "orange"
24
+ font_size 30
25
+ font_face "Arial"
26
+ font_style "bold italics"
27
+ }
28
+
29
+ world {
30
+ width 503
31
+ height 503
32
+ border_width 2
33
+ border_color "#bbb"
34
+ }
35
+
36
+ cell {
37
+ width 10
38
+ height 10
39
+ right_border_width 1
40
+ bottom_border_width 1
41
+ border_color "#bbb"
42
+ font_size 2
43
+ }
44
+
45
+ console {
46
+ width "100%"
47
+ height 100
48
+ top_margin 20
49
+ left_padding 200
50
+ }
51
+
52
+ description {
53
+ width "100%"
54
+ height 100
55
+ top_margin 10
56
+ left_padding 200
57
+ right_padding 200
58
+ text_color "black"
59
+ font_size 20
60
+ }
61
+
62
+ log {
63
+ width 400
64
+ height 60
65
+ left_padding 50
66
+ }
67
+
68
+ moves_label {
69
+ width 90
70
+ height 30
71
+ text_color "orange"
72
+ font_size 20
73
+ }
74
+
75
+ moves_counter {
76
+ width 260
77
+ height 30
78
+ text_color "black"
79
+ font_size 20
80
+ background_color "white"
81
+ border_color "black"
82
+ border_width 1
83
+ bottom_margin 5
84
+ left_padding 5
85
+ }
86
+
87
+ location_label {
88
+ width 90
89
+ height 30
90
+ text_color "orange"
91
+ font_size 20
92
+ }
93
+
94
+ location {
95
+ width 260
96
+ height 30
97
+ text_color "black"
98
+ font_size 20
99
+ background_color "white"
100
+ border_color "black"
101
+ border_width 1
102
+ bottom_margin 5
103
+ left_padding 5
104
+ }
105
+
@@ -0,0 +1,47 @@
1
+ #- Copyright 2008 8th Light, Inc.
2
+ #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
+
4
+ puts "Chromaton required"
5
+
6
+ module Chromaton
7
+
8
+ attr_accessor :clicks
9
+
10
+ def self.extended(extended_block)
11
+ puts "Chromaton extended"
12
+ extended_block.clicks = 0
13
+ extended_block.text = "Click Me!"
14
+ end
15
+
16
+ def mouse_clicked(e)
17
+ @clicks += 1
18
+ new_random_color
19
+ new_random_size
20
+ update_text
21
+ parent.update
22
+ end
23
+
24
+ private
25
+
26
+ def new_random_color
27
+ r = rand(255)
28
+ g = rand(255)
29
+ b = rand(255)
30
+ @new_color = sprintf("#%x%x%x", r, g, b)
31
+ style.background_color = @new_color
32
+ end
33
+
34
+ def new_random_size
35
+ @size = rand(500) + 50
36
+ style.width = @size.to_s
37
+ style.height = @size.to_s
38
+ end
39
+
40
+ def update_text
41
+ new_text = "Clicks: #{@clicks}"
42
+ new_text << "\nColor: #{@new_color}"
43
+ new_text << "\nSize: #{@size}"
44
+ self.text = new_text
45
+ end
46
+
47
+ end
@@ -0,0 +1,8 @@
1
+ #- Copyright 2008 8th Light, Inc.
2
+ #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
+
4
+ __ :name => "sandbox"
5
+ __install "header.rb"
6
+ arena do
7
+ chromaton
8
+ end
@@ -0,0 +1,12 @@
1
+ #- Copyright 2008 8th Light, Inc.
2
+ #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
+
4
+ chromaton {
5
+ width 100
6
+ height 100
7
+ background_color :red
8
+ text_color :white
9
+ font_size 12
10
+ horizontal_alignment :center
11
+ vertical_alignment :center
12
+ }
@@ -0,0 +1,92 @@
1
+ #- Copyright 2008 8th Light, Inc.
2
+ #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
+
4
+ require 'thread'
5
+
6
+ module Floater
7
+
8
+ FRICTION = 0.1
9
+ MAX_DISTANCE = 85
10
+ MUTEX = Mutex.new
11
+
12
+ attr_reader :sliding
13
+
14
+ def width
15
+ @width = style.width.to_i if @width.nil?
16
+ return @width
17
+ end
18
+
19
+ def x
20
+ @x = (style.x.to_i + width/2) if @x.nil?
21
+ return @x
22
+ end
23
+
24
+ def new_x=(value)
25
+ @x = value
26
+ style.x = (value.to_i - width/2).to_s
27
+ end
28
+
29
+ def y
30
+ @y = (style.y.to_i + width/2) if @y.nil?
31
+ return @y
32
+ end
33
+
34
+ def new_y=(value)
35
+ @y = value
36
+ style.y = (value.to_i - width/2).to_s
37
+ end
38
+
39
+ def center
40
+ return x, y
41
+ end
42
+
43
+ def get_away_from(source_x, source_y)
44
+ return if @sliding
45
+ d = distance(x, y, source_x, source_y)
46
+ return if d > MAX_DISTANCE
47
+ calculate_vector(source_x, source_y)
48
+ Thread.new { slide }
49
+ end
50
+
51
+ def calculate_vector(sx, sy)
52
+ dx = (x - sx)
53
+ dy = (y - sy)
54
+ @x_coefficient = dx / (dx.abs + dy.abs)
55
+ @y_coefficient = dy / (dx.abs + dy.abs)
56
+ @velocity = 20
57
+ find_bounds if @max_x.nil?
58
+ end
59
+
60
+ def slide
61
+ @sliding = true
62
+ while @velocity > 1
63
+ @x_coefficient *= -1 if(x < @min_x || x > @max_x)
64
+ @y_coefficient *= -1 if(y < @min_y || y > @max_y)
65
+ x2 = x + (@x_coefficient * @velocity)
66
+ y2 = y + (@y_coefficient * @velocity)
67
+ self.new_x = x2
68
+ self.new_y = y2
69
+ @velocity -= @velocity * FRICTION
70
+ MUTEX.synchronize { parent.update_now }
71
+ Thread.pass
72
+ end
73
+ @sliding = false
74
+ end
75
+
76
+ def find_bounds
77
+ @min_x = width/2
78
+ @min_y = width/2
79
+ parent_width = parent.panel.width
80
+ parent_height = parent.panel.height
81
+ @max_x = parent_width - width/2
82
+ @max_y = parent_height - width/2
83
+ end
84
+
85
+ def distance(x1, y1, x2, y2)
86
+ dx = x1 - x2
87
+ dy = y1 - y2
88
+ d = Math.sqrt(dx*dx + dy*dy)
89
+ return d
90
+ end
91
+
92
+ end
@@ -0,0 +1,17 @@
1
+ #- Copyright 2008 8th Light, Inc.
2
+ #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
+
4
+ module Surface
5
+
6
+ def floaters
7
+ @floaters = parent.find_by_name("floater") if @floaters.nil?
8
+ return @floaters
9
+ end
10
+
11
+ def mouse_moved(e)
12
+ x = e.x
13
+ y = e.y
14
+ floaters.each { |floater| floater.get_away_from(x, y) }
15
+ end
16
+
17
+ end
@@ -0,0 +1,10 @@
1
+ #- Copyright 2008 8th Light, Inc.
2
+ #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
+
4
+ __ :name => "sandbox"
5
+ __install "header.rb"
6
+ arena do
7
+ surface
8
+ floater :x => "100", :y => "100", :text => "Thing 1"
9
+ floater :x => "600", :y => "600", :text => "Thing 2", :background_color => "#e59846bb", :border_color => "#b75f01"
10
+ end
@@ -0,0 +1,25 @@
1
+ #- Copyright 2008 8th Light, Inc.
2
+ #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
+
4
+ floater {
5
+ float :on
6
+ width 100
7
+ height 100
8
+ border_width 2
9
+ border_color "#1b5212"
10
+ background_color "#6fb963bb"
11
+ text_color :white
12
+ font_size 12
13
+ horizontal_alignment :center
14
+ vertical_alignment :center
15
+ }
16
+
17
+ surface {
18
+ width "100%"
19
+ height "100%"
20
+ background_image "images/limelight_spotlight.jpg"
21
+ # background_color "#c7cffa"
22
+ # secondary_background_color "#505050"
23
+ # gradient_angle 315
24
+ # gradient_penetration 100
25
+ }
@@ -0,0 +1,23 @@
1
+ #- Copyright 2008 8th Light, Inc.
2
+ #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
+
4
+ module Spinner
5
+
6
+ def mouse_entered(e)
7
+ @active = true
8
+ @thread = Thread.new { spin }
9
+ end
10
+
11
+ def mouse_exited(e)
12
+ @active = false
13
+ end
14
+
15
+ def spin
16
+ while @active
17
+ style.gradient_angle = (style.gradient_angle.to_i + 1).to_s
18
+ update_now
19
+ sleep(0.02)
20
+ end
21
+ end
22
+
23
+ end
@@ -0,0 +1,26 @@
1
+ #- Copyright 2008 8th Light, Inc.
2
+ #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
+
4
+ module Teaser
5
+
6
+ def mouse_entered(e)
7
+ @active = true
8
+ @step = -1
9
+ @thread = Thread.new { wave }
10
+ end
11
+
12
+ def mouse_exited(e)
13
+ @active = false
14
+ end
15
+
16
+ def wave
17
+ while @active
18
+ @step = -1 if style.gradient_penetration == "100"
19
+ @step = 1 if style.gradient_penetration == "1"
20
+ style.gradient_penetration = (style.gradient_penetration.to_i + @step).to_s
21
+ update_now
22
+ sleep(0.02)
23
+ end
24
+ end
25
+
26
+ end
@@ -0,0 +1,26 @@
1
+ #- Copyright 2008 8th Light, Inc.
2
+ #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
+
4
+ module Wave
5
+
6
+ def mouse_entered(e)
7
+ @active = true
8
+ @step = -1
9
+ @thread = Thread.new { wave }
10
+ end
11
+
12
+ def mouse_exited(e)
13
+ @active = false
14
+ end
15
+
16
+ def wave
17
+ while @active
18
+ @step = -1 if style.gradient_penetration == "100"
19
+ @step = 1 if style.gradient_penetration == "1"
20
+ style.gradient_penetration = (style.gradient_penetration.to_i + @step).to_s
21
+ update_now
22
+ sleep(0.02)
23
+ end
24
+ end
25
+
26
+ end
@@ -0,0 +1,26 @@
1
+ #- Copyright 2008 8th Light, Inc.
2
+ #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
+
4
+ module Waves
5
+
6
+ def mouse_entered(e)
7
+ @active = true
8
+ @step = -1
9
+ @thread = Thread.new { wave }
10
+ end
11
+
12
+ def mouse_exited(e)
13
+ @active = false
14
+ end
15
+
16
+ def wave
17
+ while @active
18
+ @step = -1 if style.gradient_penetration == "100"
19
+ @step = 1 if style.gradient_penetration == "1"
20
+ style.gradient_penetration = (style.gradient_penetration.to_i + @step).to_s
21
+ update_now
22
+ sleep(0.02)
23
+ end
24
+ end
25
+
26
+ end
@@ -0,0 +1,13 @@
1
+ #- Copyright 2008 8th Light, Inc.
2
+ #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
+
4
+ __ :name => "sandbox"
5
+ __install "header.rb"
6
+ arena do
7
+ spinner
8
+ wave
9
+ waves
10
+ teaser_back do
11
+ teaser
12
+ end
13
+ end
@@ -0,0 +1,47 @@
1
+ #- Copyright 2008 8th Light, Inc.
2
+ #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
+
4
+ sample {
5
+ width 320
6
+ height 320
7
+ gradient :on
8
+ }
9
+
10
+ spinner {
11
+ extends :sample
12
+ background_color :green
13
+ secondary_background_color :blue
14
+ gradient_angle 0
15
+ gradient_penetration 100
16
+ }
17
+
18
+ wave {
19
+ extends :sample
20
+ background_color :red
21
+ secondary_background_color :yellow
22
+ gradient_angle 0
23
+ gradient_penetration 100
24
+ }
25
+
26
+ waves {
27
+ extends :sample
28
+ background_color "#F0F"
29
+ secondary_background_color "#222"
30
+ gradient_angle 90
31
+ gradient_penetration 100
32
+ cyclic_gradient :on
33
+ }
34
+
35
+ teaser_back {
36
+ extends :sample
37
+ gradient :off
38
+ background_image "images/arch.jpg"
39
+ }
40
+
41
+ teaser {
42
+ extends :sample
43
+ background_color "#0000"
44
+ secondary_background_color :black
45
+ gradient_angle 45
46
+ gradient_penetration 100
47
+ }
@@ -0,0 +1,15 @@
1
+ #- Copyright 2008 8th Light, Inc.
2
+ #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
+
4
+ header do
5
+ example_link :text => "Click Me", :on_mouse_clicked => "scene.load('click_me')"
6
+ example_link :text => "Teaser (color transparency)", :on_mouse_clicked => "scene.load('teaser')"
7
+ example_link :text => "Homer (transparency)", :on_mouse_clicked => "scene.load('homer')"
8
+ example_link :text => "Gradients", :on_mouse_clicked => "scene.load('gradients')"
9
+ example_link :text => "Scrolling", :on_mouse_clicked => "scene.load('scrolling')"
10
+ example_link :text => "Inputs", :on_mouse_clicked => "scene.load('inputs')"
11
+ example_link :text => "Rounded Corners", :on_mouse_clicked => "scene.load('rounded_corners')"
12
+ example_link :text => "Floaters", :on_mouse_clicked => "scene.load('floaters')"
13
+ example_link :text => "Sketching", :on_mouse_clicked => "scene.load('sketching')"
14
+ end
15
+
@@ -0,0 +1,20 @@
1
+ #- Copyright 2008 8th Light, Inc.
2
+ #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
+
4
+ module Homer
5
+
6
+ def mouse_entered(e)
7
+ 100.times do |i|
8
+ style.transparency = (100 - i).to_s
9
+ update_now
10
+ end
11
+ end
12
+
13
+ def mouse_exited(e)
14
+ 100.times do |i|
15
+ style.transparency = i.to_s
16
+ update_now
17
+ end
18
+ end
19
+
20
+ end
@@ -0,0 +1,10 @@
1
+ #- Copyright 2008 8th Light, Inc.
2
+ #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
+
4
+ __ :name => "sandbox"
5
+ __install "header.rb"
6
+ arena do
7
+ beach do
8
+ homer
9
+ end
10
+ end
@@ -0,0 +1,17 @@
1
+ #- Copyright 2008 8th Light, Inc.
2
+ #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
+
4
+ beach {
5
+ width 640
6
+ height 480
7
+ horizontal_alignment :center
8
+ vertical_alignment :center
9
+ background_image "images/beach.jpg"
10
+ }
11
+
12
+ homer {
13
+ width 320
14
+ height 452
15
+ background_image "images/homer.jpg"
16
+ transparency 100
17
+ }
@@ -0,0 +1,48 @@
1
+ #- Copyright 2008 8th Light, Inc.
2
+ #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
+
4
+ puts "REQUIRED"
5
+
6
+ module ButtonInput
7
+
8
+ def self.extended(prop)
9
+ puts "BUTTON INOPUT EXTENDED"
10
+ end
11
+
12
+ def key_pressed(e)
13
+ print("#{e.key_char} pressed")
14
+ end
15
+
16
+ def key_typed(e)
17
+ print("#{e.key_char} typed")
18
+ end
19
+
20
+ def key_released(e)
21
+ print("#{e.key_char} released")
22
+ end
23
+
24
+ def focus_gained(e)
25
+ print("gained focused")
26
+ end
27
+
28
+ def focus_lost(e)
29
+ print("lost focus")
30
+ end
31
+
32
+ def button_pressed(e)
33
+ @presses += 1 if @presses
34
+ @presses = 1 if @presses.nil?
35
+ print("pressed")
36
+ end
37
+
38
+ def print(value)
39
+ log = scene.find("button_log")
40
+ log.text += value + "\n"
41
+ log.update
42
+
43
+ results = scene.find("button_results")
44
+ results.text = "Pressed #{@presses} time(s)."
45
+ results.update
46
+ end
47
+
48
+ end
@@ -0,0 +1,40 @@
1
+ #- Copyright 2008 8th Light, Inc.
2
+ #- Limelight and all included source files are distributed under terms of the GNU LGPL.
3
+
4
+ module CheckBoxInput
5
+
6
+ def key_pressed(e)
7
+ print("#{e.key_char} pressed")
8
+ end
9
+
10
+ def key_typed(e)
11
+ print("#{e.key_char} typed")
12
+ end
13
+
14
+ def key_released(e)
15
+ print("#{e.key_char} released")
16
+ end
17
+
18
+ def focus_gained(e)
19
+ print("gained focused")
20
+ end
21
+
22
+ def focus_lost(e)
23
+ print("lost focus")
24
+ end
25
+
26
+ def button_pressed(e)
27
+ print("pressed")
28
+ end
29
+
30
+ def print(value)
31
+ log = scene.find("check_box_log")
32
+ log.text += value + "\n"
33
+ log.update
34
+
35
+ results = scene.find("check_box_results")
36
+ results.text = self.checked? ? "checked" : "unchecked"
37
+ results.update
38
+ end
39
+
40
+ end