From 6253a4daea8aaa03b0f95867a0143dcc2d35f9f8 Mon Sep 17 00:00:00 2001 From: Insality Date: Sat, 9 May 2020 16:30:08 +0300 Subject: [PATCH 1/3] Update changelog --- docs_md/changelog.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs_md/changelog.md b/docs_md/changelog.md index e809c88..58470f9 100644 --- a/docs_md/changelog.md +++ b/docs_md/changelog.md @@ -54,10 +54,10 @@ Druid 0.4.0: - on_drag_start (self) - on_drag (self, dx, dy) - on_drag_end (self) - - You can restriction side of draggin by changing _drag.can_x_ and _drag.can_y_ fields - - You can setup drag deadzone to detect, when dragging is started (by default 10 pixels) + - You can restriction side of dragging by changing _drag.can_x_ and _drag.can_y_ fields + - You can setup drag deadzone to detect, when dragging is started (_by default 10 pixels_) -- Druid _Scroll_ component fully reworked. Input logic moved to _Drag_ component +- [Breaking changes] Druid _Scroll_ component fully reworked. Input logic moved to _Drag_ component - Update scroll documentation - Change constructor order params - Change _scroll:set_border_ to _scroll:set_size_ @@ -69,7 +69,7 @@ Druid 0.4.0: - Different anchoring is supported (for easier layouting) - Function _scroll_to_ now accept position relative to _content node_. It's more easier for handling. _Example:_ if you have children node of _content_node_, you can pass this node position to scroll to this. - **Resolve #52**: _Content node size_ now can be less than _view node size_. In this case, content will be scrolled only inside _view size_ (can be disabled via style field: _SMALL_CONTENT_SCROLL_) - - **Fix #50**: If style:SOFT_ZONE_SIZE equals to [0..1], scroll can be disappeared + - **Fix #50**: If style.SOFT_ZONE_SIZE equals to [0..1], scroll can be disappeared - Druid _Grid_ Update - Anchor by default equals to node pivot (so, more component settings in _.gui_ settings) (#51) @@ -81,13 +81,13 @@ Druid 0.4.0: - Styles update: - Styles table now can be empty, every component have their default style values - - Remove `component:get_style` function. Now style can be only set + - Remove `component:get_style` function. Now you can only set styles - To get style values in component, add `component:on_style_change` function. It's invoked on `component:set_style` function - - You can look up default values inside `component:on_style_change` function or style component API on Druid API + - You can look up default values inside `component:on_style_change` function or style component API on [Druid API](https://insality.github.io/druid/index.html) - Druid update: - Now function `druid:remove` remove instance and all instance children components. No more manual deleting child components (#41) -- **Fix:** Blocker component bug (blocker had very high priority, so it's block even button components, created after bloker) +- **Fix:** Blocker component bug (blocker had very high priority, so it's block even button components, created after blocker) - **Fix #58:** Bug, when druid instance should be always named `druid` (ex: `self.druid = druid.new(self)`) - **Fix #53:** Bug with final _Druid instance_ without any components From bcb7ae04b36dbd1142bc334cde260127b30052e8 Mon Sep 17 00:00:00 2001 From: Insality Date: Sat, 9 May 2020 16:34:52 +0300 Subject: [PATCH 2/3] Update LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 9868db5..9dcf007 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 Alexey Gulev +Copyright (c) 2020 Maxim Tuprikov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 2db45b27e2ab531ca51b937cd1a179829119bcc0 Mon Sep 17 00:00:00 2001 From: Insality Date: Sat, 16 May 2020 16:54:48 +0300 Subject: [PATCH 3/3] #61 fix button anim node --- druid/base/button.lua | 2 +- example/gui/main/main.gui | 278 +++++++++++++++++++++++++++++++++++ example/page/button_page.lua | 3 + 3 files changed, 282 insertions(+), 1 deletion(-) diff --git a/druid/base/button.lua b/druid/base/button.lua index 4aeabb3..08cb288 100644 --- a/druid/base/button.lua +++ b/druid/base/button.lua @@ -165,7 +165,7 @@ function M.init(self, node, callback, params, anim_node) self.druid = self:get_druid() self.node = self:get_node(node) - self.anim_node = anim_node and helper:get_node(anim_node) or self.node + self.anim_node = anim_node and self:get_node(anim_node) or self.node self.start_scale = gui.get_scale(self.anim_node) self.start_pos = gui.get_position(self.anim_node) self.params = params diff --git a/example/gui/main/main.gui b/example/gui/main/main.gui index de6f1e6..da41fdc 100644 --- a/example/gui/main/main.gui +++ b/example/gui/main/main.gui @@ -5286,6 +5286,284 @@ nodes { text_leading: 1.0 text_tracking: 0.0 } +nodes { + position { + x: 0.0 + y: 280.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_TEMPLATE + id: "button_anim" + parent: "button_page" + layer: "" + inherit_alpha: true + alpha: 1.0 + template: "/example/templates/button.gui" + template_node_child: false +} +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: 130.0 + y: 60.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: "kenney/button_blue" + id: "button_anim/button" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + adjust_mode: ADJUST_MODE_FIT + parent: "button_anim" + layer: "image" + inherit_alpha: true + slice9 { + x: 15.0 + y: 15.0 + z: 15.0 + w: 15.0 + } + clipping_mode: CLIPPING_MODE_NONE + clipping_visible: true + clipping_inverted: false + alpha: 1.0 + template_node_child: true + size_mode: SIZE_MODE_MANUAL +} +nodes { + position { + x: 0.0 + y: 7.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 0.6 + y: 0.6 + 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: "Anim node" + font: "game" + id: "button_anim/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.101960786 + y: 0.2 + z: 0.6 + w: 1.0 + } + adjust_mode: ADJUST_MODE_FIT + line_break: false + parent: "button_anim/button" + layer: "text" + inherit_alpha: true + alpha: 1.0 + outline_alpha: 0.0 + shadow_alpha: 0.78 + overridden_fields: 3 + overridden_fields: 8 + template_node_child: true + text_leading: 1.0 + text_tracking: 0.0 +} +nodes { + position { + x: 62.0 + y: 305.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: 36.0 + y: 36.0 + z: 0.0 + w: 1.0 + } + color { + x: 1.0 + y: 1.0 + z: 0.4 + w: 1.0 + } + type: TYPE_BOX + blend_mode: BLEND_MODE_ALPHA + texture: "kenney/slider_move" + id: "anim_node_icon" + xanchor: XANCHOR_NONE + yanchor: YANCHOR_NONE + pivot: PIVOT_CENTER + adjust_mode: ADJUST_MODE_FIT + parent: "button_page" + 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: 2.0 + y: 2.0 + z: 0.0 + w: 1.0 + } + rotation { + x: 0.0 + y: 0.0 + z: 0.0 + w: 1.0 + } + scale { + x: 0.8 + y: 0.8 + z: 1.0 + w: 1.0 + } + size { + x: 40.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_TEXT + blend_mode: BLEND_MODE_ALPHA + text: "?" + font: "game" + id: "anim_node_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: 1.0 + y: 1.0 + z: 1.0 + w: 1.0 + } + adjust_mode: ADJUST_MODE_FIT + line_break: false + parent: "anim_node_icon" + layer: "" + inherit_alpha: true + alpha: 1.0 + outline_alpha: 0.0 + shadow_alpha: 0.0 + template_node_child: false + text_leading: 1.0 + text_tracking: 0.0 +} nodes { position { x: 1800.0 diff --git a/example/page/button_page.lua b/example/page/button_page.lua index e736935..2e8b19b 100644 --- a/example/page/button_page.lua +++ b/example/page/button_page.lua @@ -42,6 +42,9 @@ local function setup_buttons(self) button_space:set_key_trigger("key_space") button_space.on_long_click:subscribe(long_tap_callback) button_space.on_double_click:subscribe(double_tap_callback) + + -- Button with another node for animating + self.druid:new_button("button_anim/button", usual_callback, nil, "anim_node_icon") end