diff --git a/main/car/car.collection b/main/car/car.collection index 55959b67..99caa4d2 100644 --- a/main/car/car.collection +++ b/main/car/car.collection @@ -27,7 +27,7 @@ embedded_instances { " component: \"/assets/test.rivemodel\"\n" " position {\n" " x: 0.0\n" - " y: 254.0\n" + " y: 0.0\n" " z: 0.0\n" " }\n" " rotation {\n" @@ -36,6 +36,8 @@ embedded_instances { " z: 0.0\n" " w: 1.0\n" " }\n" + " property_decls {\n" + " }\n" "}\n" "components {\n" " id: \"main\"\n" @@ -51,11 +53,13 @@ embedded_instances { " z: 0.0\n" " w: 1.0\n" " }\n" + " property_decls {\n" + " }\n" "}\n" "" position { x: 256.0 - y: 256.0 + y: 269.0 z: 0.0 } rotation { @@ -86,6 +90,8 @@ embedded_instances { " z: 0.0\n" " w: 1.0\n" " }\n" + " property_decls {\n" + " }\n" "}\n" "" position { diff --git a/main/nested/nested.collection b/main/lights/lights.collection similarity index 82% rename from main/nested/nested.collection rename to main/lights/lights.collection index f3d647df..7a856c3a 100644 --- a/main/nested/nested.collection +++ b/main/lights/lights.collection @@ -1,4 +1,4 @@ -name: "nested" +name: "lights" instances { id: "back" prototype: "/main/menu/back.go" @@ -23,8 +23,8 @@ scale_along_z: 0 embedded_instances { id: "go" data: "components {\n" - " id: \"lights1\"\n" - " component: \"/main/nested/lights.rivemodel\"\n" + " id: \"lights\"\n" + " component: \"/main/lights/lights.rivemodel\"\n" " position {\n" " x: 0.0\n" " y: 0.0\n" @@ -36,11 +36,13 @@ embedded_instances { " z: 0.0\n" " w: 1.0\n" " }\n" + " property_decls {\n" + " }\n" "}\n" "" position { x: 480.0 - y: 320.0 + y: 270.0 z: 0.0 } rotation { diff --git a/main/nested/lights.riv b/main/lights/lights.riv similarity index 100% rename from main/nested/lights.riv rename to main/lights/lights.riv diff --git a/main/nested/lights.rivemodel b/main/lights/lights.rivemodel similarity index 64% rename from main/nested/lights.rivemodel rename to main/lights/lights.rivemodel index b09213e3..362621cc 100644 --- a/main/nested/lights.rivemodel +++ b/main/lights/lights.rivemodel @@ -1,5 +1,7 @@ -scene: "/main/nested/lights.rivescene" +scene: "/main/lights/lights.rivescene" default_animation: "Animation 1" material: "/defold-rive/assets/rivemodel.material" blend_mode: BLEND_MODE_ALPHA default_state_machine: "" +create_go_bones: false +artboard: "" diff --git a/main/nested/lights.rivescene b/main/lights/lights.rivescene similarity index 55% rename from main/nested/lights.rivescene rename to main/lights/lights.rivescene index 597ecb70..df47a872 100644 --- a/main/nested/lights.rivescene +++ b/main/lights/lights.rivescene @@ -1,2 +1,2 @@ -scene: "/main/nested/lights.riv" +scene: "/main/lights/lights.riv" atlas: "/defold-rive/assets/empty.atlas" diff --git a/main/loader.collection b/main/loader.collection index 64f42f76..e5a8bdb3 100644 --- a/main/loader.collection +++ b/main/loader.collection @@ -92,9 +92,9 @@ embedded_instances { " }\n" "}\n" "embedded_components {\n" - " id: \"nested\"\n" + " id: \"lights\"\n" " type: \"collectionproxy\"\n" - " data: \"collection: \\\"/main/nested/nested.collection\\\"\\n" + " data: \"collection: \\\"/main/lights/lights.collection\\\"\\n" "exclude: false\\n" "\"\n" " position {\n" @@ -181,6 +181,24 @@ embedded_instances { " w: 1.0\n" " }\n" "}\n" + "embedded_components {\n" + " id: \"takethis\"\n" + " type: \"collectionproxy\"\n" + " data: \"collection: \\\"/main/takethis/takethis.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 diff --git a/main/menu/menu.gui_script b/main/menu/menu.gui_script index 560c4c9e..8906a2f5 100644 --- a/main/menu/menu.gui_script +++ b/main/menu/menu.gui_script @@ -2,14 +2,14 @@ local dirtylarry = require "dirtylarry/dirtylarry" local BUTTONS = { - "car", - "nested", - --"bones", - --"cursor", - --"state", - --"stroke", - "sophiahud", - "scifihud" + { id = "car", text = "Car" }, + { id = "lights", text = "Lights" }, + --{ id = "bones", text = "Bones" }, + --{ id = "cursor", text = "Cursor" }, + --{ id = "state", text = "State" }, + { id = "sophiahud", text = "Sophia" }, + { id = "scifihud", text = "Sci-fi" }, + --{ id = "takethis", text = "Take This!" }, } local COLUMNS = 3 local WIDTH = 220 @@ -18,13 +18,13 @@ local HEIGHT = 70 function init(self) msg.post(".", "acquire_input_focus") local node = gui.get_node("template/larrybutton") - for i,id in ipairs(BUTTONS) do + for i,btn in ipairs(BUTTONS) do local clone = gui.clone_tree(node) local larrylabel = clone[hash("template/larrylabel")] local larrybutton = clone[hash("template/larrybutton")] - gui.set_id(larrylabel, id .. "/larrylabel") - gui.set_id(larrybutton, id .. "/larrybutton") - gui.set_text(larrylabel, id:upper()) + gui.set_id(larrylabel, btn.id .. "/larrylabel") + gui.set_id(larrybutton, btn.id .. "/larrybutton") + gui.set_text(larrylabel, btn.text:upper()) local x = 280 + ((i - 1) % COLUMNS) * WIDTH local y = 400 - math.floor((i - 1) / COLUMNS) * HEIGHT @@ -38,9 +38,9 @@ local function show_screen(id) end function on_input(self, action_id, action) - for _,id in ipairs(BUTTONS) do - dirtylarry:button(id, action_id, action, function () - show_screen(id) + for _,btn in ipairs(BUTTONS) do + dirtylarry:button(btn.id, action_id, action, function () + show_screen(btn.id) end) end end diff --git a/main/scifihud/scifihud.script b/main/scifihud/scifihud.script index c5d1a07f..459a7256 100644 --- a/main/scifihud/scifihud.script +++ b/main/scifihud/scifihud.script @@ -1,15 +1,9 @@ -go.property("health", 100) -go.property("shield", 100) - function init(self) msg.post(".", "acquire_input_focus") - go.animate("#", "health", go.PLAYBACK_LOOP_PINGPONG, 0, go.EASING_INOUTQUAD, 5) - go.animate("#", "shield", go.PLAYBACK_LOOP_PINGPONG, 0, go.EASING_INOUTQUAD, 4, 2) -end - -function update(self, dt) - go.set("#hud", "Health", self.health) - go.set("#hud", "Shield", self.shield) + go.set("#hud", "Health", 100) + go.set("#hud", "Shield", 100) + go.animate("#hud", "Health", go.PLAYBACK_LOOP_PINGPONG, 0, go.EASING_INOUTQUAD, 5) + go.animate("#hud", "Shield", go.PLAYBACK_LOOP_PINGPONG, 0, go.EASING_INOUTQUAD, 4, 2) end function on_input(self, action_id, action) diff --git a/main/takethis/5639-11052-here-take-this.riv b/main/takethis/5639-11052-here-take-this.riv new file mode 100644 index 00000000..858297f8 Binary files /dev/null and b/main/takethis/5639-11052-here-take-this.riv differ diff --git a/main/takethis/takethis.collection b/main/takethis/takethis.collection new file mode 100644 index 00000000..84e09f3a --- /dev/null +++ b/main/takethis/takethis.collection @@ -0,0 +1,65 @@ +name: "adpolice" +instances { + id: "back" + prototype: "/main/menu/back.go" + 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 + } +} +scale_along_z: 0 +embedded_instances { + id: "go" + data: "embedded_components {\n" + " id: \"rivemodel\"\n" + " type: \"rivemodel\"\n" + " data: \"scene: \\\"/main/takethis/takethis.rivescene\\\"\\n" + "default_animation: \\\"\\\"\\n" + "material: \\\"/defold-rive/assets/rivemodel.material\\\"\\n" + "blend_mode: BLEND_MODE_ALPHA\\n" + "default_state_machine: \\\"State Machine 1\\\"\\n" + "create_go_bones: false\\n" + "artboard: \\\"main\\\"\\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: 643.0 + y: 479.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 + } +} diff --git a/main/takethis/takethis.rivescene b/main/takethis/takethis.rivescene new file mode 100644 index 00000000..ec9ead87 --- /dev/null +++ b/main/takethis/takethis.rivescene @@ -0,0 +1,2 @@ +scene: "/main/takethis/5639-11052-here-take-this.riv" +atlas: "/defold-rive/assets/empty.atlas"