From d49cd2777efc5a541bac3c07fc2e3cb5cf272ec2 Mon Sep 17 00:00:00 2001 From: Maxim Tuprikov Date: Wed, 3 Apr 2019 23:23:06 +0300 Subject: [PATCH] Feature/progress (#17) * improve example gui. Add simple pages * return old progress bar with example * base progress with steps, there is bug with step? 1 ~= 1, small delta? * polish progress, check float error case * add callback on end of "to" function, value check * start of green/red in progress * add first version of rich progress bar * make green bar darker * rich bar fixes * add delay, before filling in rich progress * PR fixes * remove dublicate of 'progress_rich' --- druid/base/button.lua | 4 +- druid/base/progress.lua | 150 ++++ druid/base/text.lua | 14 +- druid/base/timer.lua | 9 +- druid/druid.lua | 3 + druid/{helper => }/helper.lua | 21 + druid/rich/progress_rich.lua | 55 ++ druid/settings.lua | 8 + example/example.gui | 1034 ++++++++++++++++++++++++++- example/example.gui.gui_script | 103 ++- example/gui.atlas | 19 +- example/res/custom.texture_profiles | 18 + example/res/empty.png | Bin 0 -> 14525 bytes example/res/progress_back.png | Bin 0 -> 1790 bytes example/res/progress_green.png | Bin 0 -> 15890 bytes example/res/progress_red.png | Bin 0 -> 15883 bytes example/res/progress_yellow.png | Bin 0 -> 1447 bytes game.project | 7 +- 18 files changed, 1382 insertions(+), 63 deletions(-) create mode 100644 druid/base/progress.lua rename druid/{helper => }/helper.lua (79%) create mode 100644 druid/rich/progress_rich.lua create mode 100644 example/res/custom.texture_profiles create mode 100755 example/res/empty.png create mode 100755 example/res/progress_back.png create mode 100755 example/res/progress_green.png create mode 100755 example/res/progress_red.png create mode 100755 example/res/progress_yellow.png diff --git a/druid/base/button.lua b/druid/base/button.lua index 001f1a1..f7ebb6c 100644 --- a/druid/base/button.lua +++ b/druid/base/button.lua @@ -1,7 +1,7 @@ local data = require("druid.data") local ui_animate = require("druid.helper.druid_animate") local settings = require("druid.settings") -local helper = require("druid.helper.helper") +local helper = require("druid.helper") local b_settings = settings.button local M = {} @@ -18,7 +18,7 @@ M.DEFAUL_ACTIVATION_TIME = 0.2 function M.init(instance, node, callback, params, anim_node, event) instance.node = helper.get_node(node) instance.event = data.A_TOUCH - instance.anim_node = anim_node and gui.get_node(anim_node) or instance.node + instance.anim_node = anim_node and helper.get_node(anim_node) or instance.node instance.scale_from = gui.get_scale(instance.anim_node) instance.scale_to = instance.scale_from + b_settings.SCALE_CHANGE instance.scale_hover_to = instance.scale_from + b_settings.HOVER_SCALE diff --git a/druid/base/progress.lua b/druid/base/progress.lua new file mode 100644 index 0000000..69eebe3 --- /dev/null +++ b/druid/base/progress.lua @@ -0,0 +1,150 @@ +local data = require("druid.data") +local helper = require("druid.helper") +local settings = require("druid.settings") +local p_settings = settings.progress + +local M = {} + +M.interest = { + data.ON_UPDATE, +} + +local PROP_Y = "y" +local PROP_X = "x" + + +function M.init(instance, name, key, init_value) + if key ~= PROP_X and key ~= PROP_Y then + settings.log("progress component: key must be 'x' or 'y'. Passed:", key) + key = PROP_X + end + + instance.prop = hash("scale."..key) + instance.key = key + + instance.node = helper.get_node(name) + instance.scale = gui.get_scale(instance.node) + instance.size = gui.get_size(instance.node) + instance.max_size = instance.size[instance.key] + instance.slice = gui.get_slice9(instance.node) + if key == PROP_X then + instance.slice_size = instance.slice.x + instance.slice.z + else + instance.slice_size = instance.slice.y + instance.slice.w + end + + instance:set_to(init_value or 1) +end + + +local function check_steps(instance, from, to, exactly) + if not instance.steps then + return + end + + for i = 1, #instance.steps do + local step = instance.steps[i] + local v1, v2 = from, to + if v1 > v2 then + v1, v2 = v2, v1 + end + + if v1 < step and step < v2 then + instance.step_callback(instance.parent.parent, step) + end + if exactly and exactly == step then + instance.step_callback(instance.parent.parent, step) + end + end +end + + +local function set_bar_to(instance, set_to, is_silence) + local prev_value = instance.last_value + instance.last_value = set_to + + local total_width = set_to * instance.max_size + + local scale = math.min(total_width / instance.slice_size, 1) + local size = math.max(total_width, instance.slice_size) + + instance.scale[instance.key] = scale + gui.set_scale(instance.node, instance.scale) + instance.size[instance.key] = size + gui.set_size(instance.node, instance.size) + + if not is_silence then + check_steps(instance, prev_value, set_to) + end +end + + +--- Fill a progress bar and stop progress animation +function M.fill(instance) + set_bar_to(instance, 1, true) +end + + +--- To empty a progress bar +function M.empty(instance) + set_bar_to(instance, 0, true) +end + + +--- Set fill a progress bar to value +-- @param to - value between 0..1 +function M.set_to(instance, to) + set_bar_to(instance, to) +end + + +function M.get(instance) + return instance.last_value +end + + +function M.set_steps(instance, steps, step_callback) + instance.steps = steps + instance.step_callback = step_callback +end + + +--- Start animation of a progress bar +-- @param to - value between 0..1 +-- @param callback - callback when progress ended if need +function M.to(instance, to, callback) + to = helper.clamp(to, 0, 1) + -- cause of float error + local value = helper.round(to, 5) + if value ~= instance.last_value then + instance.target = value + instance.target_callback = callback + else + if callback then + callback(instance.parent.parent, to) + end + end +end + + +function M.update(instance, dt) + if instance.target then + local prev_value = instance.last_value + local step = math.abs(instance.last_value - instance.target) * (p_settings.SPEED*dt) + step = math.max(step, p_settings.MIN_DELTA) + instance:set_to(helper.step(instance.last_value, instance.target, step)) + + if instance.last_value == instance.target then + check_steps(instance, prev_value, instance.target, instance.target) + + if instance.target_callback then + instance.target_callback(instance.parent.parent, instance.target) + end + + instance.target = nil + end + end +end + + +return M \ No newline at end of file diff --git a/druid/base/text.lua b/druid/base/text.lua index f107589..3f3993f 100644 --- a/druid/base/text.lua +++ b/druid/base/text.lua @@ -1,11 +1,10 @@ local data = require("druid.data") local settings = require("druid.settings") -local helper = require("druid.helper.helper") +local helper = require("druid.helper") local M = {} M.interest = { data.TRANSLATABLE, - data.LAYOUT_CHANGED } @@ -82,15 +81,4 @@ function M.set_scale(instance, scale) end ---- Called when layout updated (rotate for example) -function M.on_layout_updated(instance) - if instance.last_color then - M.set_color(instance, instance.last_color) - end - if instance.last_scale then - M.set_scale(instance, instance.last_scale) - end -end - - return M \ No newline at end of file diff --git a/druid/base/timer.lua b/druid/base/timer.lua index 38deb1c..14cb8c6 100644 --- a/druid/base/timer.lua +++ b/druid/base/timer.lua @@ -1,10 +1,9 @@ local data = require("druid.data") local formats = require("druid.helper.formats") -local helper = require("druid.helper.helper") +local helper = require("druid.helper") local M = {} M.interest = { - data.LAYOUT_CHANGED, data.ON_UPDATE } @@ -36,12 +35,6 @@ function M.set_to(instance, set_to) end ---- Called when layout updated (rotate for example) -function M.on_layout_updated(instance) - M.set_to(instance, instance.last_value) -end - - --- Called when update -- @param is_on - boolean is timer on function M.set_state(instance, is_on) diff --git a/druid/druid.lua b/druid/druid.lua index a7592b0..b85147e 100644 --- a/druid/druid.lua +++ b/druid/druid.lua @@ -12,6 +12,9 @@ M.comps = { android_back = require("druid.base.android_back"), text = require("druid.base.text"), timer = require("druid.base.timer"), + progress = require("druid.base.progress"), + + progress_rich = require("druid.rich.progress_rich"), } diff --git a/druid/helper/helper.lua b/druid/helper.lua similarity index 79% rename from druid/helper/helper.lua rename to druid/helper.lua index a23f5c9..0e01c65 100644 --- a/druid/helper/helper.lua +++ b/druid/helper.lua @@ -36,6 +36,27 @@ function M.step(current, target, step) end +function M.clamp(a, min, max) + if min > max then + min, max = max, min + end + + if a >= min and a <= max then + return a + elseif a < min then + return min + else + return max + end +end + + +function M.round(num, numDecimalPlaces) + local mult = 10^(numDecimalPlaces or 0) + return math.floor(num * mult + 0.5) / mult +end + + function M.is_enabled(node) local is_enabled = gui.is_enabled(node) local parent = gui.get_parent(node) diff --git a/druid/rich/progress_rich.lua b/druid/rich/progress_rich.lua new file mode 100644 index 0000000..8785794 --- /dev/null +++ b/druid/rich/progress_rich.lua @@ -0,0 +1,55 @@ +local settings = require("druid.settings") +local pr_settings = settings.progress_rich + +local M = {} + +function M.init(instance, name, red, green, key) + instance.red = instance.parent:new_progress(red, key) + instance.green = instance.parent:new_progress(green, key) + instance.fill = instance.parent:new_progress(name, key) +end + + +function M.set_to(instance, value) + instance.red:set_to(value) + instance.green:set_to(value) + instance.fill:set_to(value) +end + + +function M.empty(instance) + instance.red:empty() + instance.green:empty() + instance.fill:empty() +end + + +function M.to(instance, to, callback) + if instance.timer then + timer.cancel(instance.timer) + instance.timer = nil + end + + if instance.fill.last_value < to then + instance.red:to(instance.fill.last_value) + instance.green:to(to, function() + instance.timer = timer.delay(pr_settings.DELAY, false, function() + instance.red:to(to) + instance.fill:to(to, callback) + end) + end) + end + + if instance.fill.last_value > to then + instance.green:to(instance.red.last_value) + instance.fill:to(to, function() + instance.timer = timer.delay(pr_settings.DELAY, false, function() + instance.green:to(to) + instance.red:to(to, callback) + end) + end) + end +end + + +return M \ No newline at end of file diff --git a/druid/settings.lua b/druid/settings.lua index 4cf4fbc..323ab3e 100644 --- a/druid/settings.lua +++ b/druid/settings.lua @@ -12,6 +12,14 @@ M.button = { SCALE_CHANGE = vmath.vector3(-0.05, - 0.05, 1), } +M.progress = { + SPEED = 5, -- progress bar fill rate, more faster + MIN_DELTA = 0.005 +} + +M.progress_rich = { + DELAY = 1, -- delay in seconds before main fill +} function M.get_text(name) diff --git a/example/example.gui b/example/example.gui index eb5d5b0..5669836 100644 --- a/example/example.gui +++ b/example/example.gui @@ -15,8 +15,407 @@ background_color { } nodes { position { + x: 300.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + size { + x: 1.0 + y: 1.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "gui/empty" + id: "control" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + adjust_mode: ADJUST_MODE_FIT + layer: "" + inherit_alpha: true + slice9 { + x: 0.0 + y: 0.0 + z: 0.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + template_node_child: false + size_mode: SIZE_MODE_AUTO +} +nodes { + position { + x: -150.0 + y: 50.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 0.5 + y: 0.5 + z: 1.0 + w: 1.0 + } + size { + x: 426.0 + y: 190.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "gui/green_long" + id: "prev" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + adjust_mode: ADJUST_MODE_FIT + parent: "control" + layer: "" + inherit_alpha: true + slice9 { + x: 0.0 + y: 0.0 + z: 0.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + template_node_child: false + size_mode: SIZE_MODE_AUTO +} +nodes { + position { + x: 0.0 + y: 20.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + size { x: 200.0 - y: 325.0 + y: 100.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_TEXT + blend_mode: BLEND_MODE_ALPHA + text: "Prev" + font: "game" + id: "prev_text" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + outline { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + shadow { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + adjust_mode: ADJUST_MODE_FIT + line_break: false + parent: "prev" + layer: "" + inherit_alpha: true + alpha: 1.0 + outline_alpha: 1.0 + shadow_alpha: 1.0 + template_node_child: false + text_leading: 1.0 + text_tracking: 0.0 +} +nodes { + position { + x: 150.0 + y: 50.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 0.5 + y: 0.5 + z: 1.0 + w: 1.0 + } + size { + x: 426.0 + y: 190.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "gui/green_long" + id: "next" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + adjust_mode: ADJUST_MODE_FIT + parent: "control" + layer: "" + inherit_alpha: true + slice9 { + x: 0.0 + y: 0.0 + z: 0.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + template_node_child: false + size_mode: SIZE_MODE_AUTO +} +nodes { + position { + x: 0.0 + y: 20.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + size { + x: 200.0 + y: 100.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_TEXT + blend_mode: BLEND_MODE_ALPHA + text: "Next" + font: "game" + id: "next_text" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + outline { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + shadow { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + adjust_mode: ADJUST_MODE_FIT + line_break: false + parent: "next" + layer: "" + inherit_alpha: true + alpha: 1.0 + outline_alpha: 1.0 + shadow_alpha: 1.0 + template_node_child: false + text_leading: 1.0 + text_tracking: 0.0 +} +nodes { + position { + x: 300.0 + y: 400.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + size { + x: 1.0 + y: 1.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "gui/empty" + id: "center" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + adjust_mode: ADJUST_MODE_FIT + layer: "" + inherit_alpha: true + slice9 { + x: 0.0 + y: 0.0 + z: 0.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + template_node_child: false + size_mode: SIZE_MODE_AUTO +} +nodes { + position { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + size { + x: 1.0 + y: 1.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "gui/empty" + id: "buttons" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + adjust_mode: ADJUST_MODE_FIT + parent: "center" + layer: "" + inherit_alpha: true + slice9 { + x: 0.0 + y: 0.0 + z: 0.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + template_node_child: false + size_mode: SIZE_MODE_AUTO +} +nodes { + position { + x: 0.0 + y: 254.0 z: 0.0 w: 1.0 } @@ -52,6 +451,7 @@ nodes { yanchor: YANCHOR_NONE pivot: PIVOT_CENTER adjust_mode: ADJUST_MODE_FIT + parent: "buttons" layer: "" inherit_alpha: true slice9 { @@ -132,8 +532,8 @@ nodes { } nodes { position { - x: 200.0 - y: 200.0 + x: 0.0 + y: 129.0 z: 0.0 w: 1.0 } @@ -169,6 +569,7 @@ nodes { yanchor: YANCHOR_NONE pivot: PIVOT_CENTER adjust_mode: ADJUST_MODE_FIT + parent: "buttons" layer: "" inherit_alpha: true slice9 { @@ -249,8 +650,503 @@ nodes { } nodes { position { - x: 200.0 - y: 75.0 + x: 600.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + size { + x: 1.0 + y: 1.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "gui/empty" + id: "progress" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + adjust_mode: ADJUST_MODE_FIT + parent: "center" + layer: "" + inherit_alpha: true + slice9 { + x: 0.0 + y: 0.0 + z: 0.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + template_node_child: false + size_mode: SIZE_MODE_AUTO +} +nodes { + position { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + size { + x: 391.0 + y: 40.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "gui/progress_back" + id: "simple_back" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + adjust_mode: ADJUST_MODE_FIT + parent: "progress" + layer: "" + inherit_alpha: true + slice9 { + x: 0.0 + y: 0.0 + z: 0.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + template_node_child: false + size_mode: SIZE_MODE_AUTO +} +nodes { + position { + x: -194.5 + y: 2.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + size { + x: 389.0 + y: 35.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "gui/progress_yellow" + id: "simple_fill" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_W + adjust_mode: ADJUST_MODE_FIT + parent: "simple_back" + layer: "" + inherit_alpha: true + slice9 { + x: 15.0 + y: 0.0 + z: 15.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + template_node_child: false + size_mode: SIZE_MODE_MANUAL +} +nodes { + position { + x: 0.0 + y: 106.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + size { + x: 391.0 + y: 40.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "gui/progress_back" + id: "simple_vert" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + adjust_mode: ADJUST_MODE_FIT + parent: "progress" + layer: "" + inherit_alpha: true + slice9 { + x: 0.0 + y: 0.0 + z: 0.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + template_node_child: false + size_mode: SIZE_MODE_AUTO +} +nodes { + position { + x: 0.0 + y: -17.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + size { + x: 389.0 + y: 35.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "gui/progress_yellow" + id: "simple_vert_fill" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_S + adjust_mode: ADJUST_MODE_FIT + parent: "simple_vert" + layer: "" + inherit_alpha: true + slice9 { + x: 15.0 + y: 0.0 + z: 15.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + template_node_child: false + size_mode: SIZE_MODE_MANUAL +} +nodes { + position { + x: 0.0 + y: -130.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + size { + x: 391.0 + y: 40.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "gui/progress_back" + id: "rich_back" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + adjust_mode: ADJUST_MODE_FIT + parent: "progress" + layer: "" + inherit_alpha: true + slice9 { + x: 0.0 + y: 0.0 + z: 0.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + template_node_child: false + size_mode: SIZE_MODE_AUTO +} +nodes { + position { + x: -194.5 + y: 2.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + size { + x: 389.0 + y: 35.0 + z: 0.0 + w: 1.0 + } + color { + x: 0.6 + y: 0.6 + z: 0.6 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "gui/progress_green" + id: "rich_green" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_W + adjust_mode: ADJUST_MODE_FIT + parent: "rich_back" + layer: "" + inherit_alpha: true + slice9 { + x: 15.0 + y: 0.0 + z: 15.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + template_node_child: false + size_mode: SIZE_MODE_MANUAL +} +nodes { + position { + x: -194.5 + y: 2.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + size { + x: 389.0 + y: 35.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "gui/progress_red" + id: "rich_red" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_W + adjust_mode: ADJUST_MODE_FIT + parent: "rich_back" + layer: "" + inherit_alpha: true + slice9 { + x: 15.0 + y: 0.0 + z: 15.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + template_node_child: false + size_mode: SIZE_MODE_MANUAL +} +nodes { + position { + x: -194.5 + y: 2.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + size { + x: 389.0 + y: 35.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "gui/progress_yellow" + id: "rich_fill" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_W + adjust_mode: ADJUST_MODE_FIT + parent: "rich_back" + layer: "" + inherit_alpha: true + slice9 { + x: 15.0 + y: 0.0 + z: 15.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + template_node_child: false + size_mode: SIZE_MODE_MANUAL +} +nodes { + position { + x: 110.0 + y: 250.0 z: 0.0 w: 1.0 } @@ -281,11 +1177,12 @@ nodes { type: TYPE_BOX blend_mode: BLEND_MODE_ALPHA texture: "gui/green_long" - id: "button_3" + id: "rich_add" xanchor: XANCHOR_NONE yanchor: YANCHOR_NONE pivot: PIVOT_CENTER adjust_mode: ADJUST_MODE_FIT + parent: "progress" layer: "" inherit_alpha: true slice9 { @@ -334,9 +1231,9 @@ nodes { } type: TYPE_TEXT blend_mode: BLEND_MODE_ALPHA - text: "Button 3" + text: "add rich" font: "game" - id: "text_3" + id: "rich_add_text" xanchor: XANCHOR_NONE yanchor: YANCHOR_NONE pivot: PIVOT_CENTER @@ -354,7 +1251,126 @@ nodes { } adjust_mode: ADJUST_MODE_FIT line_break: false - parent: "button_3" + parent: "rich_add" + layer: "" + inherit_alpha: true + alpha: 1.0 + outline_alpha: 1.0 + shadow_alpha: 1.0 + template_node_child: false + text_leading: 1.0 + text_tracking: 0.0 +} +nodes { + position { + x: -110.0 + y: 250.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 0.5 + y: 0.5 + z: 1.0 + w: 1.0 + } + size { + x: 426.0 + y: 190.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "gui/green_long" + id: "rich_dec" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + adjust_mode: ADJUST_MODE_FIT + parent: "progress" + layer: "" + inherit_alpha: true + slice9 { + x: 0.0 + y: 0.0 + z: 0.0 + w: 0.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + template_node_child: false + size_mode: SIZE_MODE_AUTO +} +nodes { + position { + x: 0.0 + y: 20.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + size { + x: 200.0 + y: 100.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + type: TYPE_TEXT + blend_mode: BLEND_MODE_ALPHA + text: "dec rich\n" + "" + font: "game" + id: "rich_dec_text" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + outline { + x: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + shadow { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + adjust_mode: ADJUST_MODE_FIT + line_break: false + parent: "rich_dec" layer: "" inherit_alpha: true alpha: 1.0 diff --git a/example/example.gui.gui_script b/example/example.gui.gui_script index ec37096..1b4bc7a 100644 --- a/example/example.gui.gui_script +++ b/example/example.gui.gui_script @@ -4,52 +4,101 @@ local druid_settings = require("druid.settings") local lang = { locale_text = "Localized" } +local start_x = 300 +local page_width = 600 +local cur_page = 1 +local max_page = 2 + + + +local function log(self, params) + print(params) +end + local function setup_druid(self) - -- two different way of exernal component regesstration druid.comps["my_mega_test_comp"] = require "druid.base.text" druid.register("my_custom_component", {}) - + druid_settings.is_debug = true - druid_settings.play_sound = function(name) sound.play("sounds#" .. name) end - druid_settings.get_text = function(text_id) return lang[text_id] end end + +local function change_page(self, delta) + cur_page = cur_page + delta + cur_page = math.max(1, cur_page) + cur_page = math.min(cur_page, max_page) + + gui.animate(gui.get_node("center"), "position.x", + start_x - (page_width * (cur_page - 1)), gui.EASING_OUTSINE, 0.1) +end + +local function init_pages(self) + self.druid:new_button("prev", change_page, -1) + self.druid:new_button("next", change_page, 1) +end + + +local function init_buttons(self) + self.druid:new_button("button_1", log, "button 1") + + self.druid:new(druid.comps.button, "button_2", log, "button 2") +end + + +local function init_progress(self) + local val = 0.4 + local simple = self.druid:new_progress("simple_fill", "x", val) + local vert = self.druid:new_progress("simple_vert_fill", "y", val) + + simple:set_steps({0, 0.3, 0.6, 1}, function(self, step) + print("STEP:", step) + end) + + timer.delay(0.4, true, function() + val = val + 0.1 + if val > 1 then + simple:empty() + vert:empty() + val = 0 + end + simple:to(val) + vert:to(val) + end) + + + local rich = self.druid:new_progress_rich("rich_fill", "rich_red", "rich_green", "x") + + rich:set_to(0.3) + + local rich_val = 0.3 + self.druid:new_button("rich_add", function() + rich_val = rich_val + 0.1 + rich:to(rich_val) + end) + self.druid:new_button("rich_dec", function() + rich_val = rich_val - 0.1 + rich:to(rich_val) + end) +end + + function init(self) setup_druid(self) self.druid = druid.new(self) - self.druid:new_button("button_1", function() - print("On button 1") - end) - - --alternative way of component creation - self.druid:new(druid.comps.button, "button_2", function() - print("On button 2") - end) - - self.druid:new_button("button_3", function() - print("On button 3") - end) - - self.druid:new_android_back(function(self, params) - print("On android back", params) - end, 2) - - self.druid:new_text("text_2", "Simple text", false, 400) - self.druid:new_text("text_3", "locale_text", true) - - self.druid:new_timer("text_1", 5, 0, function() - print("On timer end") - end) + init_pages(self) + init_buttons(self) + init_progress(self) + self.druid:new_android_back(log, "some") end function update(self, dt) diff --git a/example/gui.atlas b/example/gui.atlas index 0170ec5..6cb5a3a 100644 --- a/example/gui.atlas +++ b/example/gui.atlas @@ -4,6 +4,21 @@ images { images { image: "/example/res/green_long.png" } -margin: 0 -extrude_borders: 0 +images { + image: "/example/res/progress_back.png" +} +images { + image: "/example/res/progress_green.png" +} +images { + image: "/example/res/progress_red.png" +} +images { + image: "/example/res/progress_yellow.png" +} +images { + image: "/example/res/empty.png" +} +margin: 2 +extrude_borders: 2 inner_padding: 0 diff --git a/example/res/custom.texture_profiles b/example/res/custom.texture_profiles new file mode 100644 index 0000000..5b0d776 --- /dev/null +++ b/example/res/custom.texture_profiles @@ -0,0 +1,18 @@ +path_settings { + path: "**" + profile: "Default" +} +profiles { + name: "Default" + platforms { + os: OS_ID_GENERIC + formats { + format: TEXTURE_FORMAT_RGBA + compression_level: BEST + compression_type: COMPRESSION_TYPE_DEFAULT + } + mipmaps: false + max_texture_size: 0 + premultiply_alpha: true + } +} diff --git a/example/res/empty.png b/example/res/empty.png new file mode 100755 index 0000000000000000000000000000000000000000..5da9ec0922e6066d3284b286ec892cc4f6745636 GIT binary patch literal 14525 zcmeI3O>g5w7{{lqgu0dXgjPsg*7AaQb;eHOw6UC2B`LHL?pAFO>7JO_lh$ft8{65W zJs~*l4NiOlBu*T-a^S)TK;nSJC*Z~vBt)69Q|C#Vbav4mCsN|a z@Zr6U*ESGB_xAVNN9?%9zw0lv-v{@9e##DaqrH=a9pB{NwRi4*{RpA0*Zod6?K&S> zZa6FvFYM9MWEe38LiY9~BJMd&l^#9ygNFL&k3Xr3?={p zOXEr@j8Cyquh+3&#^tic6k2i-q-3H6$-_L!b)Gg&+}Mv&KMWL}m-NC>+E7(qsQ66p zYZw)Uf@I2$QN$AxVWXtuWhT!pJkcl~WL@)IOb2vGgEV12W2rAX3)3(;3s;mZF0U-i z#>8=o+DrR894;-Lq`OZTf+^Ca&ZKh@QG7&`a1^_A_X)d|hs*9h_4~8Inajkltn53T z_$zGuN^Z-hLOwz^yH~3fQ<8>pCkzM8e3l(vBUD-~KC3pBw;ba70q6R*jTcR`5ufFw zZIaR^^KNN+S<}r z$RjCvrYukk@_4S*591+8oBoiTQXB=RHl8&CWihX;RyYV_)-Bqs*mzkpaAkAN+7FVH z1TNigH(5i;_dUz2dVT59Z=s3`RBXv7;M|{0Z zQ+v;u8rW~7eiZv`uOkDX;k|#}5=+wDD7EJ&Y=&Ndnak#HwwoQ(&*odNFAV%_SBglS zP`>6G>h+>4wy|QD;+|~nTEyl1S<~f9f_gTdYn^qga87Oh{~f?QKd`T^F+QWgZ3`+- zm8n)INy2_QCNbSPWpm=$R(qaz-ndx6#{3^(;Li_5-a0=**K_vfh}wK(v)F84JtNsD z7&gAqHmjWLyL?m!qg=1E4>tJk)CsRHI!|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VcqaCUu^yek*nKybTXa zBSndmi}A_o_U*h=oK}%mlsdZf9ChcEnO&9{Ro6fCEKOxks6hFFhL;kBQi(^Ah>C`! z_Vn(#U_U3DN(uVS5-|E@%P(oWFH${Qg{fr&56n&;!|E?#eldG3q)`5v<^ z=GC1WPCqEwsj1ByXXXbVE}3|6^VH?+qA#Oh@Aig`pTu7*p7?%u-#>&mGAfWOhj!J+ zm7RJ2&e`U13*ArLVt53uKQUH2iTh6Zx+P2Y`bsDG&9R=Z3^;kYd5lc_czSp$emkp+ zvmW#us>~E-u1)!>V}J2IO)`~YyML|s#5qFJJ==@&^Vij$ z=OWYb$$RJ#cfs89A!E+AjD3?99N45gJ!(%^hCRm^(n}Fgswpcv?gg{zGK=5-bn@&# z_04;!FVjkJ+ZSWK-r5zU@_Ox5$L`uA*=rlG7R(sm74TU6l0Os%ZJ`7~OKLCr<_5{j z{Vjaj*oi^@e&xpGk~7KH#X4TdLgOe&W#K<@Ls-(<1Iw--tSy{du)xyxar-Bu-(t{U zbY)WPwz}8LK3z5?sc-p}Qt0vS&^|9g1NZo^4}PNAUs+?*+g`Ozw%v<3AwTWWcXIv4 zvX;KH(|cd;Dwt7tH+OPx<45wY!p6eNkH32xKXI-I4Bt(fO{T{|&8Sy(?itLT5@UNfu! literal 0 HcmV?d00001 diff --git a/example/res/progress_yellow.png b/example/res/progress_yellow.png new file mode 100755 index 0000000000000000000000000000000000000000..3e4e38d959eef9831526d07b6b37b60934767ff9 GIT binary patch literal 1447 zcmV;Y1z7rtP)B#u+WAz7C<7=*odN03k!V7YUzJ~B$D6;E!>1?EY!b%Eu}H| z-XNltB$y2y&|qRC6d)AB?#!HHo^#KgxibuEx9rUClT3E@&MZ53nLNLF?z#6I`~9oO zF#`)md&X~pnGJ!N+3J3)ZTT?+Fj~L?;CWy_up8J8Y(+#w*4i!LCU6C~0GtKRk?18L z#YC^0=yoEVmBi;~4&C!|+qu@8(P|m3cA&k%#s$Jd7)OA&fnEA<7ZG_NZ7sJ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Z(eVjeD`-U-rO%;7Q*rNA{h{&3|4cq{(02j&_@i`v_{$H;Q_y>2k4O4<+oVfr1002ovPDHLkV1gvO BzJCA! literal 0 HcmV?d00001 diff --git a/game.project b/game.project index adf34bf..c62a018 100644 --- a/game.project +++ b/game.project @@ -5,8 +5,8 @@ main_collection = /example/example.collectionc shared_state = 1 [display] -width = 400 -height = 400 +width = 600 +height = 900 [project] title = druid @@ -14,3 +14,6 @@ title = druid [library] include_dirs = druid +[graphics] +texture_profiles = /example/res/custom.texture_profiles +