diff --git a/defold_game/.editor_settings b/defold_game/.editor_settings index 262c3c6..35625a4 100644 --- a/defold_game/.editor_settings +++ b/defold_game/.editor_settings @@ -6,34 +6,14 @@ :workflow { :open-tabs [ [ - [ - "/main/main.atlas" - :scene - ] [ "/main/main.collection" :scene ] [ - "/main/player.tilesource" - :scene - ] - [ - "/main/player.script" + "/main/zoom.script" :code ] - [ - "/game.project" - :cljfx-form-view - ] - [ - "/input/game.input_binding" - :cljfx-form-view - ] - [ - "/main/player.sprite" - :scene - ] ] ] :recent-files [ @@ -46,7 +26,15 @@ :text ] [ - "/main/player.tilesource" + "/main/main.script" + :code + ] + [ + "/main/main.collection" + :text + ] + [ + "/main/player.sprite" :scene ] [ @@ -54,29 +42,41 @@ :scene ] [ - "/main/player.sprite" - :scene - ] - [ - "/input/game.input_binding" - :cljfx-form-view - ] - [ - "/main/main.script" - :code - ] - [ - "/game.project" - :cljfx-form-view - ] - [ - "/main/main.collection" + "/main/player.tilesource" :scene ] [ "/main/player.script" :code ] + [ + "/main/zoom.render_script" + :code + ] + [ + "/builtins/render/default.render_script" + :code + ] + [ + "/builtins/render/default.render" + :cljfx-form-view + ] + [ + "/input/game.input_binding" + :cljfx-form-view + ] + [ + "/game.project" + :cljfx-form-view + ] + [ + "/main/zoom.script" + :code + ] + [ + "/main/main.collection" + :scene + ] ] } } \ No newline at end of file diff --git a/defold_game/main/main.collection b/defold_game/main/main.collection index 0f528cb..1b06cfa 100644 --- a/defold_game/main/main.collection +++ b/defold_game/main/main.collection @@ -2,7 +2,11 @@ name: "main" scale_along_z: 0 embedded_instances { id: "camera" - data: "embedded_components {\n" + data: "components {\n" + " id: \"zoom\"\n" + " component: \"/main/zoom.script\"\n" + "}\n" + "embedded_components {\n" " id: \"camera\"\n" " type: \"camera\"\n" " data: \"aspect_ratio: 1.0\\n" @@ -10,7 +14,7 @@ embedded_instances { "near_z: -1.0\\n" "far_z: 1.0\\n" "orthographic_projection: 1\\n" - "orthographic_mode: ORTHO_MODE_AUTO_COVER\\n" + "orthographic_zoom: 2.0\\n" "\"\n" "}\n" "" diff --git a/defold_game/main/zoom.script b/defold_game/main/zoom.script new file mode 100644 index 0000000..5b87f22 --- /dev/null +++ b/defold_game/main/zoom.script @@ -0,0 +1,60 @@ +function init(self) + -- Add initialization code here + -- Learn more: https://defold.com/manuals/script/ + -- Remove this function if not needed + msg.post("@render:", "use_fixed_projection", { near = -1, far = 1, zoom = 5 }) + +end + +function final(self) + -- Add finalization code here + -- Learn more: https://defold.com/manuals/script/ + -- Remove this function if not needed +end + +function update(self, dt) + -- Add update code here + -- Learn more: https://defold.com/manuals/script/ + -- Remove this function if not needed + msg.post("@render:", "use_fixed_projection", { near = -1, far = 1, zoom = 5 }) + +end + +function late_update(self, dt) + -- This function is called at the end of update cycle but before render + -- Learn more: https://defold.com/manuals/script/ + -- Remove this function if not needed +end + +function fixed_update(self, dt) + -- This function is called if 'Fixed Update Frequency' is enabled in the Engine section of game.project + -- Can be coupled with fixed updates of the physics simulation if 'Use Fixed Timestep' is enabled in + -- Physics section of game.project + -- Add update code here + -- Learn more: https://defold.com/manuals/script/ + -- Remove this function if not needed +end + +function on_message(self, message_id, message, sender) + -- Add message-handling code here + -- Learn more: https://defold.com/manuals/message-passing/ + -- Remove this function if not needed +end + +function on_input(self, action_id, action) + -- Add input-handling code here. The game object this script is attached to + -- must have acquired input focus: + -- + -- msg.post(".", "acquire_input_focus") + -- + -- All mapped input bindings will be received. Mouse and touch input will + -- be received regardless of where on the screen it happened. + -- Learn more: https://defold.com/manuals/input/ + -- Remove this function if not needed +end + +function on_reload(self) + -- Add reload-handling code here + -- Learn more: https://defold.com/manuals/hot-reload/ + -- Remove this function if not needed +end