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.
- data/bin/icons/icon.ico +0 -0
- data/bin/icons/icon_48.gif +0 -0
- data/bin/icons/limelight.icns +0 -0
- data/bin/icons/splash.png +0 -0
- data/bin/limelight +6 -0
- data/bin/ll +10 -0
- data/bin/ll.bat +5 -0
- data/lib/init.rb +11 -0
- data/lib/limelight/build_exception.rb +45 -0
- data/lib/limelight/button_group_cache.rb +11 -0
- data/lib/limelight/casting_director.rb +72 -0
- data/lib/limelight/commands.rb +66 -0
- data/lib/limelight/file_chooser.rb +55 -0
- data/lib/limelight/file_filter.rb +26 -0
- data/lib/limelight/java_util.rb +29 -0
- data/lib/limelight/limelight_exception.rb +9 -0
- data/lib/limelight/loaders/file_scene_loader.rb +48 -0
- data/lib/limelight/menu_bar.rb +49 -0
- data/lib/limelight/paint_action.rb +25 -0
- data/lib/limelight/pen.rb +53 -0
- data/lib/limelight/players/button.rb +29 -0
- data/lib/limelight/players/check_box.rb +38 -0
- data/lib/limelight/players/combo_box.rb +44 -0
- data/lib/limelight/players/radio_button.rb +47 -0
- data/lib/limelight/players/text_area.rb +25 -0
- data/lib/limelight/players/text_box.rb +25 -0
- data/lib/limelight/players.rb +9 -0
- data/lib/limelight/producer.rb +141 -0
- data/lib/limelight/production.rb +64 -0
- data/lib/limelight/production_builder.rb +49 -0
- data/lib/limelight/prop.rb +241 -0
- data/lib/limelight/prop_builder.rb +60 -0
- data/lib/limelight/scene.rb +75 -0
- data/lib/limelight/stage.rb +93 -0
- data/lib/limelight/stage_builder.rb +62 -0
- data/lib/limelight/styles.rb +37 -0
- data/lib/limelight/styles_builder.rb +61 -0
- data/lib/limelight/theater.rb +42 -0
- data/lib/limelight/util.rb +26 -0
- data/lib/limelight/version.rb +20 -0
- data/lib/limelight.jar +0 -0
- data/productions/examples/8thlight.com/about/about.txt +24 -0
- data/productions/examples/8thlight.com/about/props.rb +11 -0
- data/productions/examples/8thlight.com/about/styles.rb +2 -0
- data/productions/examples/8thlight.com/footer.rb +6 -0
- data/productions/examples/8thlight.com/home/props.rb +28 -0
- data/productions/examples/8thlight.com/home/styles.rb +2 -0
- data/productions/examples/8thlight.com/images/anvil.jpg +0 -0
- data/productions/examples/8thlight.com/images/bg.jpg +0 -0
- data/productions/examples/8thlight.com/images/botticelli.jpg +0 -0
- data/productions/examples/8thlight.com/images/button_bg.jpg +0 -0
- data/productions/examples/8thlight.com/images/canvas_bg.jpg +0 -0
- data/productions/examples/8thlight.com/images/footer_bg.jpg +0 -0
- data/productions/examples/8thlight.com/images/header.jpg +0 -0
- data/productions/examples/8thlight.com/images/moses.jpg +0 -0
- data/productions/examples/8thlight.com/images/statemachine_thumbnail.png +0 -0
- data/productions/examples/8thlight.com/images/thumbnail_book.jpg +0 -0
- data/productions/examples/8thlight.com/menu.rb +11 -0
- data/productions/examples/8thlight.com/services/props.rb +11 -0
- data/productions/examples/8thlight.com/services/services.txt +8 -0
- data/productions/examples/8thlight.com/services/styles.rb +2 -0
- data/productions/examples/8thlight.com/stages.rb +8 -0
- data/productions/examples/8thlight.com/styles.rb +205 -0
- data/productions/examples/calculator/players/button.rb +24 -0
- data/productions/examples/calculator/players/calculator.rb +15 -0
- data/productions/examples/calculator/players/calculator_model.rb +13 -0
- data/productions/examples/calculator/props.rb +23 -0
- data/productions/examples/calculator/styles.rb +38 -0
- data/productions/examples/langstons_ant/html_javascript/ant.css +39 -0
- data/productions/examples/langstons_ant/html_javascript/ant.html +22 -0
- data/productions/examples/langstons_ant/html_javascript/ant.js +23 -0
- data/productions/examples/langstons_ant/players/ant.rb +103 -0
- data/productions/examples/langstons_ant/players/log.rb +29 -0
- data/productions/examples/langstons_ant/players/start_stop_button.rb +37 -0
- data/productions/examples/langstons_ant/players/world.rb +61 -0
- data/productions/examples/langstons_ant/props.rb +22 -0
- data/productions/examples/langstons_ant/styles.rb +105 -0
- data/productions/examples/sandbox/click_me/players/chromaton.rb +47 -0
- data/productions/examples/sandbox/click_me/props.rb +8 -0
- data/productions/examples/sandbox/click_me/styles.rb +12 -0
- data/productions/examples/sandbox/floaters/players/floater.rb +92 -0
- data/productions/examples/sandbox/floaters/players/surface.rb +17 -0
- data/productions/examples/sandbox/floaters/props.rb +10 -0
- data/productions/examples/sandbox/floaters/styles.rb +25 -0
- data/productions/examples/sandbox/gradients/players/spinner.rb +23 -0
- data/productions/examples/sandbox/gradients/players/teaser.rb +26 -0
- data/productions/examples/sandbox/gradients/players/wave.rb +26 -0
- data/productions/examples/sandbox/gradients/players/waves.rb +26 -0
- data/productions/examples/sandbox/gradients/props.rb +13 -0
- data/productions/examples/sandbox/gradients/styles.rb +47 -0
- data/productions/examples/sandbox/header.rb +15 -0
- data/productions/examples/sandbox/homer/players/homer.rb +20 -0
- data/productions/examples/sandbox/homer/props.rb +10 -0
- data/productions/examples/sandbox/homer/styles.rb +17 -0
- data/productions/examples/sandbox/images/arch.jpg +0 -0
- data/productions/examples/sandbox/images/beach.jpg +0 -0
- data/productions/examples/sandbox/images/homer.jpg +0 -0
- data/productions/examples/sandbox/images/limelight_spotlight.jpg +0 -0
- data/productions/examples/sandbox/images/marilyn.jpg +0 -0
- data/productions/examples/sandbox/inputs/players/button_input.rb +48 -0
- data/productions/examples/sandbox/inputs/players/check_box_input.rb +40 -0
- data/productions/examples/sandbox/inputs/players/combo_box_input.rb +41 -0
- data/productions/examples/sandbox/inputs/players/radio_button_input.rb +43 -0
- data/productions/examples/sandbox/inputs/players/text_area_input.rb +36 -0
- data/productions/examples/sandbox/inputs/players/text_box_input.rb +36 -0
- data/productions/examples/sandbox/inputs/props.rb +40 -0
- data/productions/examples/sandbox/inputs/styles.rb +39 -0
- data/productions/examples/sandbox/players/sandbox.rb +11 -0
- data/productions/examples/sandbox/rounded_corners/players/box.rb +11 -0
- data/productions/examples/sandbox/rounded_corners/props.rb +22 -0
- data/productions/examples/sandbox/rounded_corners/styles.rb +18 -0
- data/productions/examples/sandbox/scrolling/players/cell.rb +16 -0
- data/productions/examples/sandbox/scrolling/props.rb +40 -0
- data/productions/examples/sandbox/scrolling/styles.rb +25 -0
- data/productions/examples/sandbox/sketching/players/sketchpad.rb +46 -0
- data/productions/examples/sandbox/sketching/props.rb +25 -0
- data/productions/examples/sandbox/sketching/styles.rb +36 -0
- data/productions/examples/sandbox/stages.rb +6 -0
- data/productions/examples/sandbox/styles.rb +37 -0
- data/productions/examples/sandbox/teaser/players/fader.rb +58 -0
- data/productions/examples/sandbox/teaser/props.rb +14 -0
- data/productions/examples/sandbox/teaser/styles.rb +22 -0
- data/productions/examples/tutorials/tutorial_1/players/sample.rb +11 -0
- data/productions/examples/tutorials/tutorial_1/props.rb +9 -0
- data/productions/examples/tutorials/tutorial_1/styles.rb +27 -0
- data/productions/stage_composer/init.rb +10 -0
- data/productions/stage_composer/inspector/players/inspector.rb +80 -0
- data/productions/stage_composer/inspector/players/prop_row.rb +12 -0
- data/productions/stage_composer/inspector/players/prop_tree.rb +33 -0
- data/productions/stage_composer/inspector/players/style_table.rb +12 -0
- data/productions/stage_composer/inspector/players/style_value.rb +16 -0
- data/productions/stage_composer/inspector/props.rb +19 -0
- data/productions/stage_composer/inspector/styles.rb +71 -0
- data/productions/stage_composer/lib/init.rb +5 -0
- data/productions/stage_composer/lib/limelight/composer/controller.rb +51 -0
- data/productions/stage_composer/lib/limelight/composer/lethargy.rb +24 -0
- data/productions/stage_composer/production.rb +6 -0
- data/productions/stage_composer/stages.rb +15 -0
- data/productions/startup/props.rb +5 -0
- data/spec/casting_director_spec.rb +94 -0
- data/spec/commands_spec.rb +33 -0
- data/spec/file_chooser_spec.rb +64 -0
- data/spec/file_filter_spec.rb +29 -0
- data/spec/java_util_spec.rb +53 -0
- data/spec/loaders/file_loader_spec.rb +28 -0
- data/spec/paint_action_spec.rb +30 -0
- data/spec/pen_spec.rb +62 -0
- data/spec/players/button_spec.rb +31 -0
- data/spec/players/check_box_spec.rb +40 -0
- data/spec/players/combo_box_spec.rb +39 -0
- data/spec/players/radio_button_spec.rb +75 -0
- data/spec/players/text_area_spec.rb +37 -0
- data/spec/players/text_box_spec.rb +37 -0
- data/spec/producer_spec.rb +157 -0
- data/spec/production_builder_spec.rb +48 -0
- data/spec/production_spec.rb +75 -0
- data/spec/prop_builder_spec.rb +178 -0
- data/spec/prop_spec.rb +216 -0
- data/spec/scene_spec.rb +34 -0
- data/spec/spec_helper.rb +18 -0
- data/spec/stage_builder_spec.rb +90 -0
- data/spec/stage_spec.rb +57 -0
- data/spec/styles_builder_spec.rb +123 -0
- data/spec/theater_spec.rb +66 -0
- metadata +275 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#- Copyright 2008 8th Light, Inc.
|
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
|
+
|
|
4
|
+
module ComboBoxInput
|
|
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 item_state_changed(e)
|
|
27
|
+
print("Item State Changed")
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def print(value)
|
|
31
|
+
log = scene.find("combo_box_log")
|
|
32
|
+
return if log.nil?
|
|
33
|
+
log.text += value + "\n"
|
|
34
|
+
log.update
|
|
35
|
+
|
|
36
|
+
results = scene.find("combo_box_results")
|
|
37
|
+
results.text = "Selected value: #{self.value}"
|
|
38
|
+
results.update
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#- Copyright 2008 8th Light, Inc.
|
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
|
+
|
|
4
|
+
module RadioButtonInput
|
|
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("radio_button_log")
|
|
32
|
+
log.text += "#{id}:#{value}\n"
|
|
33
|
+
log.update
|
|
34
|
+
|
|
35
|
+
results = scene.find("radio_button_results")
|
|
36
|
+
radio1 = scene.find("radio_1")
|
|
37
|
+
radio2 = scene.find("radio_2")
|
|
38
|
+
radio3 = scene.find("radio_3")
|
|
39
|
+
results.text = "One: #{radio1.selected?}\nTwo: #{radio2.selected?}\nThree: #{radio3.selected?}"
|
|
40
|
+
results.update
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#- Copyright 2008 8th Light, Inc.
|
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
|
+
|
|
4
|
+
module TextAreaInput
|
|
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 print(value)
|
|
27
|
+
log = scene.find("text_area_log")
|
|
28
|
+
log.text += value + "\n"
|
|
29
|
+
log.update
|
|
30
|
+
|
|
31
|
+
results = scene.find("text_area_results")
|
|
32
|
+
results.text = self.text
|
|
33
|
+
results.update
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#- Copyright 2008 8th Light, Inc.
|
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
|
+
|
|
4
|
+
module TextBoxInput
|
|
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 print(value)
|
|
27
|
+
log = scene.find("text_box_log")
|
|
28
|
+
log.text += value + "\n"
|
|
29
|
+
log.update
|
|
30
|
+
|
|
31
|
+
results = scene.find("text_box_results")
|
|
32
|
+
results.text = self.text
|
|
33
|
+
results.update
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
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
|
+
__ :name => "sandbox"
|
|
5
|
+
__install "header.rb"
|
|
6
|
+
arena do
|
|
7
|
+
table do
|
|
8
|
+
cell { text_box_input :players => "text_box" }
|
|
9
|
+
cell(:border_width => "1") { input_log :id => "text_box_log" }
|
|
10
|
+
cell(:border_width => "1") { input_results :id => "text_box_results" }
|
|
11
|
+
# end row
|
|
12
|
+
cell { text_area_input :players => "text_area" }
|
|
13
|
+
cell { input_log :id => "text_area_log" }
|
|
14
|
+
cell(:border_width => "1") { input_results :id => "text_area_results" }
|
|
15
|
+
# end row
|
|
16
|
+
cell { check_box_input :players => "check_box" }
|
|
17
|
+
cell { input_log :id => "check_box_log" }
|
|
18
|
+
cell(:border_width => "1") { input_results :id => "check_box_results" }
|
|
19
|
+
# end row
|
|
20
|
+
cell do
|
|
21
|
+
radio_button_input :players => "radio_button", :id => "radio_1", :group => "radios"
|
|
22
|
+
radio_label :text => "One"
|
|
23
|
+
radio_button_input :players => "radio_button", :id => "radio_2", :group => "radios"
|
|
24
|
+
radio_label :text => "Two"
|
|
25
|
+
radio_button_input :players => "radio_button", :id => "radio_3", :group => "radios"
|
|
26
|
+
radio_label :text => "Three"
|
|
27
|
+
end
|
|
28
|
+
cell { input_log :id => "radio_button_log" }
|
|
29
|
+
cell(:border_width => "1") { input_results :id => "radio_button_results" }
|
|
30
|
+
# end row
|
|
31
|
+
cell { combo_box_input :players => "combo_box", :choices => "%w{Red Orange Yellow Green Blue Indigo Violet}" }
|
|
32
|
+
cell { input_log :id => "combo_box_log" }
|
|
33
|
+
cell(:border_width => "1") { input_results :id => "combo_box_results" }
|
|
34
|
+
# end row
|
|
35
|
+
cell { button_input :players => "button", :text => "A Button" }
|
|
36
|
+
cell { input_log :id => "button_log" }
|
|
37
|
+
cell(:border_width => "1") { input_results :id => "button_results" }
|
|
38
|
+
# end row
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#- Copyright 2008 8th Light, Inc.
|
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
|
+
|
|
4
|
+
table {
|
|
5
|
+
width 752
|
|
6
|
+
height 620
|
|
7
|
+
border_width 1
|
|
8
|
+
border_color :orange
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
cell {
|
|
12
|
+
width 250
|
|
13
|
+
height 100
|
|
14
|
+
vertical_alignment :center
|
|
15
|
+
horizontal_alignment :center
|
|
16
|
+
border_width 1
|
|
17
|
+
border_color :blue
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
input_log {
|
|
21
|
+
height "100%"
|
|
22
|
+
width "100%"
|
|
23
|
+
background_color "#999"
|
|
24
|
+
text_color "black"
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
input_results {
|
|
28
|
+
height "100%"
|
|
29
|
+
width "100%"
|
|
30
|
+
background_color "#FFD"
|
|
31
|
+
text_color :black
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
radio_label {
|
|
35
|
+
width 220
|
|
36
|
+
height 20
|
|
37
|
+
text_color :black
|
|
38
|
+
vertical_alignment :center
|
|
39
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
row do
|
|
8
|
+
5.times do |i|
|
|
9
|
+
box :rounded_corner_radius => (i * 10).to_s
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
row do
|
|
13
|
+
5.times do |i|
|
|
14
|
+
box :rounded_corner_radius => (i * 10).to_s, :background_color => "red", :border_color => "#00fa"
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
row do
|
|
18
|
+
5.times do |i|
|
|
19
|
+
box :rounded_corner_radius => (i * 10).to_s, :border_width => "0", :background_color => "red", :secondary_background_color => "green", :gradient => "on", :gradient_angle => "0", :gradient_penetration => "100"
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#- Copyright 2008 8th Light, Inc.
|
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
|
+
|
|
4
|
+
box {
|
|
5
|
+
width 100
|
|
6
|
+
height 100
|
|
7
|
+
# background_color :red
|
|
8
|
+
border_color :blue
|
|
9
|
+
border_width 5
|
|
10
|
+
margin 5
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
row {
|
|
14
|
+
width 500
|
|
15
|
+
height 100
|
|
16
|
+
horizontal_alignment :center
|
|
17
|
+
vertical_alignment :center
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#- Copyright 2008 8th Light, Inc.
|
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
|
+
|
|
4
|
+
module Cell
|
|
5
|
+
|
|
6
|
+
def self.extended(prop)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def mouse_clicked(e)
|
|
10
|
+
puts "mouse clicked"
|
|
11
|
+
p = parent
|
|
12
|
+
parent.remove(self)
|
|
13
|
+
p.parent.update # update the whole table incase a row can be removed.
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
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
|
+
__ :name => "sandbox"
|
|
5
|
+
__install "header.rb"
|
|
6
|
+
arena do
|
|
7
|
+
table do
|
|
8
|
+
10.times do |y|
|
|
9
|
+
row :id => y.to_s do
|
|
10
|
+
10.times do |x|
|
|
11
|
+
id = "#{x},#{y}"
|
|
12
|
+
bg_color = ( (x + y) % 2 == 0 ) ? "blue" : "#DDDDDD"
|
|
13
|
+
cell :id => id, :text => id, :background_color => bg_color
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
table do
|
|
19
|
+
2.times do |y|
|
|
20
|
+
row :id => y.to_s do
|
|
21
|
+
10.times do |x|
|
|
22
|
+
id = "#{x},#{y}"
|
|
23
|
+
bg_color = ( (x + y) % 2 == 0 ) ? "blue" : "#DDDDDD"
|
|
24
|
+
cell :id => id, :text => id, :background_color => bg_color
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
table do
|
|
30
|
+
10.times do |y|
|
|
31
|
+
row :id => y.to_s do
|
|
32
|
+
2.times do |x|
|
|
33
|
+
id = "#{x},#{y}"
|
|
34
|
+
bg_color = ( (x + y) % 2 == 0 ) ? "blue" : "#DDDDDD"
|
|
35
|
+
cell :id => id, :text => id, :background_color => bg_color
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
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
|
+
table {
|
|
5
|
+
width 214
|
|
6
|
+
height 214
|
|
7
|
+
border_width 2
|
|
8
|
+
border_color :black
|
|
9
|
+
background_color :yellow
|
|
10
|
+
padding 5
|
|
11
|
+
margin 5
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
row {
|
|
15
|
+
width 500
|
|
16
|
+
height :auto
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
cell {
|
|
20
|
+
width 50
|
|
21
|
+
height 50
|
|
22
|
+
text_color :black
|
|
23
|
+
vertical_alignment :center
|
|
24
|
+
horizontal_alignment :center
|
|
25
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#- Copyright 2008 8th Light, Inc.
|
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
|
+
|
|
4
|
+
module Sketchpad
|
|
5
|
+
|
|
6
|
+
def activate(mode)
|
|
7
|
+
@mode = mode
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def clear
|
|
11
|
+
puts "Clearing"
|
|
12
|
+
update
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def mouse_pressed(e)
|
|
16
|
+
return if @mode.nil?
|
|
17
|
+
self.send(@mode, e.x, e.y)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def mouse_dragged(e)
|
|
21
|
+
if(@mode == :line && !@line_start.nil?)
|
|
22
|
+
pen.draw_line(@line_start[0], @line_start[1], e.x, e.y)
|
|
23
|
+
@line_start = [e.x, e.y]
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def line(x, y)
|
|
28
|
+
@line_start = [x, y]
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def square(x, y)
|
|
32
|
+
pen = self.pen
|
|
33
|
+
pen.width = 2
|
|
34
|
+
pen.color = "blue"
|
|
35
|
+
pen.draw_rectangle(x, y, 25, 25)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def circle(x, y)
|
|
39
|
+
pen = self.pen
|
|
40
|
+
pen.smooth = true
|
|
41
|
+
pen.width = 5
|
|
42
|
+
pen.color = "red"
|
|
43
|
+
pen.draw_oval(x, y, 25, 25)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
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
|
+
__ :name => "sandbox"
|
|
5
|
+
__install "header.rb"
|
|
6
|
+
arena do
|
|
7
|
+
toolbar do
|
|
8
|
+
tool do
|
|
9
|
+
label :text => "Line\n(press and drag to draw)"
|
|
10
|
+
selector :players => "radio_button", :group => "tools", :id => "line", :on_button_pressed => "scene.find('sketchpad').activate(:line)"
|
|
11
|
+
end
|
|
12
|
+
tool do
|
|
13
|
+
label :text => "Square\n(click to draw)"
|
|
14
|
+
selector :players => "radio_button", :group => "tools", :id => "square", :on_button_pressed => "scene.find('sketchpad').activate(:square)"
|
|
15
|
+
end
|
|
16
|
+
tool do
|
|
17
|
+
label :text => "Circle\n(click to draw)"
|
|
18
|
+
selector :players => "radio_button", :group => "tools", :id => "circle", :on_button_pressed => "scene.find('sketchpad').activate(:circle)"
|
|
19
|
+
end
|
|
20
|
+
tool do
|
|
21
|
+
button :text => "Clear", :on_button_pressed => "scene.find('sketchpad').clear"
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
sketchpad :id => "sketchpad"
|
|
25
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#- Copyright 2008 8th Light, Inc.
|
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
|
+
|
|
4
|
+
toolbar {
|
|
5
|
+
width "100%"
|
|
6
|
+
height :auto
|
|
7
|
+
margin 25
|
|
8
|
+
horizontal_alignment :center
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
tool {
|
|
12
|
+
width 200
|
|
13
|
+
height 100
|
|
14
|
+
horizontal_alignment :center
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
label {
|
|
18
|
+
width 200
|
|
19
|
+
height :auto
|
|
20
|
+
horizontal_alignment :center
|
|
21
|
+
text_color :black
|
|
22
|
+
font_face :Arial
|
|
23
|
+
font_size 12
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
sketchpad {
|
|
27
|
+
width 600
|
|
28
|
+
height 600
|
|
29
|
+
border_color :black
|
|
30
|
+
border_width 2
|
|
31
|
+
background_color "#eeecb3"
|
|
32
|
+
gradient :on
|
|
33
|
+
secondary_background_color "#f2ee80"
|
|
34
|
+
gradient_penetration 100
|
|
35
|
+
gradient_angle 270
|
|
36
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#- Copyright 2008 8th Light, Inc.
|
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
|
+
|
|
4
|
+
sandbox {
|
|
5
|
+
width 900
|
|
6
|
+
height 900
|
|
7
|
+
vertical_alignment :top
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
arena {
|
|
11
|
+
width 900
|
|
12
|
+
height 800
|
|
13
|
+
horizontal_alignment :center
|
|
14
|
+
vertical_alignment :center
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
header {
|
|
18
|
+
width 900
|
|
19
|
+
height 100
|
|
20
|
+
background_color "#888"
|
|
21
|
+
border_color :blue
|
|
22
|
+
border_width 1
|
|
23
|
+
horizontal_alignment :center
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
example_link {
|
|
27
|
+
width 100
|
|
28
|
+
height 48
|
|
29
|
+
font_size 12
|
|
30
|
+
horizontal_alignment :center
|
|
31
|
+
vertical_alignment :center
|
|
32
|
+
text_color :blue
|
|
33
|
+
hover {
|
|
34
|
+
text_color :white
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#- Copyright 2008 8th Light, Inc.
|
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
|
+
|
|
4
|
+
module Fader
|
|
5
|
+
|
|
6
|
+
def self.extended(extended_block)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def mouse_entered(e)
|
|
10
|
+
@color = style.background_color
|
|
11
|
+
@base_alpha = (style.background_color[4..-1] + style.background_color[4..-1]).hex
|
|
12
|
+
@step = (255 - @base_alpha) / 80
|
|
13
|
+
@step = 1 if @step == 0
|
|
14
|
+
@should_loop = true
|
|
15
|
+
@thread = Thread.new { do_shading }
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def mouse_exited(e)
|
|
19
|
+
@should_loop = false
|
|
20
|
+
@thread.join
|
|
21
|
+
style.background_color = @color
|
|
22
|
+
update
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def do_shading
|
|
26
|
+
while @should_loop
|
|
27
|
+
shade_up
|
|
28
|
+
shade_down
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def shade_up
|
|
33
|
+
current_alpha = @base_alpha
|
|
34
|
+
while @should_loop and current_alpha < 255
|
|
35
|
+
current_alpha += @step
|
|
36
|
+
update_with_alpha(current_alpha)
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def shade_down
|
|
41
|
+
current_alpha = 255
|
|
42
|
+
while @should_loop and current_alpha > @base_alpha
|
|
43
|
+
current_alpha -= @step
|
|
44
|
+
update_with_alpha(current_alpha)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def update_with_alpha(alpha)
|
|
49
|
+
alpha_string = sprintf("%x", alpha)
|
|
50
|
+
if alpha_string.length == 1
|
|
51
|
+
alpha_string = alpha_string + "0" if alpha > 15
|
|
52
|
+
alpha_string = "0" + alpha_string if alpha < 16
|
|
53
|
+
end
|
|
54
|
+
style.background_color = "#000000#{alpha_string}"
|
|
55
|
+
update_now
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
pattern do
|
|
8
|
+
fader :background_color => "#0000", :text => "0% Alpha"
|
|
9
|
+
fader :background_color => "#0008", :text => "50% Alpha"
|
|
10
|
+
fader :background_color => "#000B", :text => "75% Alpha"
|
|
11
|
+
fader :background_color => "#000D", :text => "88% Alpha"
|
|
12
|
+
fader :background_color => "#000F", :text => "100% Alpha"
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#- Copyright 2008 8th Light, Inc.
|
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
|
+
|
|
4
|
+
pattern {
|
|
5
|
+
width 521
|
|
6
|
+
height 640
|
|
7
|
+
horizontal_alignment :center
|
|
8
|
+
vertical_alignment :center
|
|
9
|
+
background_image "images/marilyn.jpg"
|
|
10
|
+
background_image_fill_strategy :static
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
fader {
|
|
14
|
+
width 521
|
|
15
|
+
height 128
|
|
16
|
+
background_color "#0000"
|
|
17
|
+
vertical_alignment :center
|
|
18
|
+
text_color "#0F0"
|
|
19
|
+
padding 10
|
|
20
|
+
font_size 15
|
|
21
|
+
font_style :bold
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#- Copyright 2008 8th Light, Inc.
|
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
|
+
|
|
4
|
+
module Sample
|
|
5
|
+
def mouse_clicked(e)
|
|
6
|
+
puts "mouse clicked"
|
|
7
|
+
selection = scene.find('the_selection')
|
|
8
|
+
selection.style.background_color = self.style.background_color
|
|
9
|
+
selection.update
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#- Copyright 2008 8th Light, Inc.
|
|
2
|
+
#- Limelight and all included source files are distributed under terms of the GNU LGPL.
|
|
3
|
+
|
|
4
|
+
backdrop do
|
|
5
|
+
%w{ red orange yellow green blue magenta }.each do |color|
|
|
6
|
+
sample :background_color => color, :text => color
|
|
7
|
+
end
|
|
8
|
+
selection :id => "the_selection"
|
|
9
|
+
end
|