From 851f3dee873e46ec7b570ede81adb098a3da1d48 Mon Sep 17 00:00:00 2001 From: AGulev Date: Tue, 27 Feb 2024 07:55:43 +0100 Subject: [PATCH] fix font --- main/default.font | 8 ++++++++ main/main.collection | 36 ++++++++++++++++-------------------- main/main.script | 3 +-- 3 files changed, 25 insertions(+), 22 deletions(-) create mode 100644 main/default.font diff --git a/main/default.font b/main/default.font new file mode 100644 index 0000000..8be6b4c --- /dev/null +++ b/main/default.font @@ -0,0 +1,8 @@ +font: "/builtins/fonts/vera_mo_bd.ttf" +material: "/builtins/fonts/font-df.material" +size: 14 +antialias: 1 +alpha: 1.0 +shadow_alpha: 0.0 +shadow_blur: 0 +output_format: TYPE_DISTANCE_FIELD diff --git a/main/main.collection b/main/main.collection index ef9c7c0..6c57810 100644 --- a/main/main.collection +++ b/main/main.collection @@ -16,14 +16,19 @@ embedded_instances { " z: 0.0\n" " w: 1.0\n" " }\n" + " property_decls {\n" + " }\n" "}\n" "embedded_components {\n" " id: \"sprite\"\n" " type: \"sprite\"\n" - " data: \"tile_set: \\\"/main/camera.atlas\\\"\\n" - "default_animation: \\\"logo\\\"\\n" + " data: \"default_animation: \\\"logo\\\"\\n" "material: \\\"/builtins/materials/sprite.material\\\"\\n" "blend_mode: BLEND_MODE_ALPHA\\n" + "textures {\\n" + " sampler: \\\"texture_sampler\\\"\\n" + " texture: \\\"/main/camera.atlas\\\"\\n" + "}\\n" "\"\n" " position {\n" " x: 0.0\n" @@ -60,10 +65,13 @@ embedded_instances { data: "embedded_components {\n" " id: \"sprite\"\n" " type: \"sprite\"\n" - " data: \"tile_set: \\\"/main/logo.atlas\\\"\\n" - "default_animation: \\\"logo\\\"\\n" + " data: \"default_animation: \\\"logo\\\"\\n" "material: \\\"/builtins/materials/sprite.material\\\"\\n" "blend_mode: BLEND_MODE_ALPHA\\n" + "textures {\\n" + " sampler: \\\"texture_sampler\\\"\\n" + " texture: \\\"/main/logo.atlas\\\"\\n" + "}\\n" "\"\n" " position {\n" " x: 0.0\n" @@ -86,12 +94,6 @@ embedded_instances { " z: 0.0\\n" " w: 0.0\\n" "}\\n" - "scale {\\n" - " x: 1.0\\n" - " y: 1.0\\n" - " z: 1.0\\n" - " w: 0.0\\n" - "}\\n" "color {\\n" " x: 1.0\\n" " y: 1.0\\n" @@ -116,8 +118,8 @@ embedded_instances { "blend_mode: BLEND_MODE_ALPHA\\n" "line_break: false\\n" "text: \\\"Space/Touch to toggle capture\\\"\\n" - "font: \\\"/builtins/fonts/system_font.font\\\"\\n" - "material: \\\"/builtins/fonts/label.material\\\"\\n" + "font: \\\"/main/default.font\\\"\\n" + "material: \\\"/builtins/fonts/label-df.material\\\"\\n" "\"\n" " position {\n" " x: 90.0\n" @@ -140,12 +142,6 @@ embedded_instances { " z: 0.0\\n" " w: 0.0\\n" "}\\n" - "scale {\\n" - " x: 1.0\\n" - " y: 1.0\\n" - " z: 1.0\\n" - " w: 0.0\\n" - "}\\n" "color {\\n" " x: 1.0\\n" " y: 1.0\\n" @@ -172,8 +168,8 @@ embedded_instances { "text: \\\"label\\\\n" "\\\"\\n" " \\\"\\\"\\n" - "font: \\\"/builtins/fonts/system_font.font\\\"\\n" - "material: \\\"/builtins/fonts/label.material\\\"\\n" + "font: \\\"/main/default.font\\\"\\n" + "material: \\\"/builtins/fonts/label-df.material\\\"\\n" "\"\n" " position {\n" " x: 90.0\n" diff --git a/main/main.script b/main/main.script index fd50525..8f1d663 100644 --- a/main/main.script +++ b/main/main.script @@ -3,7 +3,6 @@ local function stop_capture(self) if self.cameraframe == nil then return end - self.cameraframe = nil camera.stop_capture() @@ -24,7 +23,7 @@ local function start_capture(self) type = camera.CAMERA_TYPE_BACK quality = camera.CAPTURE_QUALITY_MEDIUM end - + camera.start_capture(type, quality, function(self, status) if status == camera.CAMERA_STARTED then self.cameraframe = camera.get_frame()