Skip to content

Commit

Permalink
Improved example
Browse files Browse the repository at this point in the history
  • Loading branch information
Björn Ritzl committed Sep 11, 2017
1 parent 5803d44 commit 37c6b5a
Show file tree
Hide file tree
Showing 79 changed files with 2,935 additions and 1,046 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ The state table contains the following fields:
* ```over_now``` (boolean) - true if user action moved inside the node this call
* ```out_now``` (boolean) - true if user action moved outside the node this call
* ```selected``` (boolean) - The radio button state
* ```selected_now``` (boolean) - true if the radio button was selected this call
* ```pressed``` (boolean) - true if the radio button is pressed (ie mouse/touch down but not yet released)
* ```pressed_now``` (boolean) - true if the radio button was pressed this call
* ```released_now``` (boolean) - true if the radio button was released this call
Expand Down
3 changes: 3 additions & 0 deletions assets/fonts/example.font
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
font: "/builtins/fonts/vera_mo_bd.ttf"
material: "/builtins/fonts/font.material"
size: 15
111 changes: 0 additions & 111 deletions assets/gooey.atlas

This file was deleted.

91 changes: 91 additions & 0 deletions example/controller.collection
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: "controller"
scale_along_z: 0
embedded_instances {
id: "go"
data: "components {\n"
" id: \"controller\"\n"
" component: \"/example/controller.script\"\n"
" position {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" }\n"
" rotation {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" w: 1.0\n"
" }\n"
"}\n"
"embedded_components {\n"
" id: \"menuproxy\"\n"
" type: \"collectionproxy\"\n"
" data: \"collection: \\\"/example/menu.collection\\\"\\n"
"exclude: false\\n"
"\"\n"
" position {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" }\n"
" rotation {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" w: 1.0\n"
" }\n"
"}\n"
"embedded_components {\n"
" id: \"dirtylarryproxy\"\n"
" type: \"collectionproxy\"\n"
" data: \"collection: \\\"/example/dirtylarry.collection\\\"\\n"
"exclude: false\\n"
"\"\n"
" position {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" }\n"
" rotation {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" w: 1.0\n"
" }\n"
"}\n"
"embedded_components {\n"
" id: \"kenneyblueproxy\"\n"
" type: \"collectionproxy\"\n"
" data: \"collection: \\\"/example/kenneyblue.collection\\\"\\n"
"exclude: false\\n"
"\"\n"
" position {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" }\n"
" rotation {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" w: 1.0\n"
" }\n"
"}\n"
""
position {
x: 0.0
y: 0.0
z: 0.0
}
rotation {
x: 0.0
y: 0.0
z: 0.0
w: 1.0
}
scale3 {
x: 1.0
y: 1.0
z: 1.0
}
}
27 changes: 27 additions & 0 deletions example/controller.script
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
local function show(self, proxy)
if self.current_proxy then
msg.post(self.current_proxy, "unload")
end
msg.post(proxy, "async_load")
end

function init(self)
msg.post(".", "acquire_input_focus")
show(self, "#menuproxy")
msg.post("@render:", "clear_color", { color = vmath.vector4(0.15, 0.15, 0.15, 1.0) })
end

function on_message(self, message_id, message, sender)
if message_id == hash("proxy_loaded") then
self.current_proxy = sender
msg.post(sender, "enable")
elseif message_id == hash("show_menu") then
show(self, "#menuproxy")
elseif message_id == hash("show_dirtylarry") then
show(self, "#dirtylarryproxy")
elseif message_id == hash("show_kenneyblue") then
show(self, "#kenneyblueproxy")
else
print(message_id)
end
end
37 changes: 37 additions & 0 deletions example/dirtylarry.collection
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "dirtylarry"
scale_along_z: 0
embedded_instances {
id: "go"
data: "components {\n"
" id: \"dirtylarry\"\n"
" component: \"/example/dirtylarry.gui\"\n"
" position {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" }\n"
" rotation {\n"
" x: 0.0\n"
" y: 0.0\n"
" z: 0.0\n"
" w: 1.0\n"
" }\n"
"}\n"
""
position {
x: 0.0
y: 0.0
z: 0.0
}
rotation {
x: 0.0
y: 0.0
z: 0.0
w: 1.0
}
scale3 {
x: 1.0
y: 1.0
z: 1.0
}
}
Loading

0 comments on commit 37c6b5a

Please sign in to comment.