Resolve #36: Get default druid text value from node

This commit is contained in:
Insality 2020-03-28 16:46:50 +03:00
parent 017138b5ff
commit 7821c031dd
3 changed files with 8 additions and 8 deletions

View File

@ -85,10 +85,10 @@ function M.init(self, node, value, no_adjust)
self.color = gui.get_color(self.node) self.color = gui.get_color(self.node)
self.on_set_text = Event() self.on_set_text = Event()
self.on_update_text_scale = Event()
self.on_set_pivot = Event() self.on_set_pivot = Event()
self.on_update_text_scale = Event()
self:set_to(value or 0) self:set_to(value or gui.get_text(self.node))
return self return self
end end

View File

@ -3518,7 +3518,7 @@ nodes {
} }
type: TYPE_TEXT type: TYPE_TEXT
blend_mode: BLEND_MODE_ALPHA blend_mode: BLEND_MODE_ALPHA
text: "Inline:" text: "Simple inline text"
font: "game" font: "game"
id: "text_inline" id: "text_inline"
xanchor: XANCHOR_NONE xanchor: XANCHOR_NONE
@ -3581,7 +3581,7 @@ nodes {
} }
type: TYPE_TEXT type: TYPE_TEXT
blend_mode: BLEND_MODE_ALPHA blend_mode: BLEND_MODE_ALPHA
text: "Multiline" text: "Simple multiline text with smth"
font: "game" font: "game"
id: "text_multiline" id: "text_multiline"
xanchor: XANCHOR_NONE xanchor: XANCHOR_NONE
@ -3699,7 +3699,7 @@ nodes {
} }
type: TYPE_TEXT type: TYPE_TEXT
blend_mode: BLEND_MODE_ALPHA blend_mode: BLEND_MODE_ALPHA
text: "Anchoring:" text: "Anchoring"
font: "game" font: "game"
id: "text_anchoring" id: "text_anchoring"
xanchor: XANCHOR_NONE xanchor: XANCHOR_NONE

View File

@ -13,9 +13,9 @@ local pivots = {
} }
local function setup_texts(self) local function setup_texts(self)
self.druid:new_text("text_inline", "Simple inline text") self.druid:new_text("text_inline")
self.druid:new_text("text_multiline", "Simple multiline text with smth") self.druid:new_text("text_multiline")
local anchoring = self.druid:new_text("text_anchoring", "Anchoring") local anchoring = self.druid:new_text("text_anchoring")
self.druid:new_text("text_no_adjust", "Without adjust size", true) self.druid:new_text("text_no_adjust", "Without adjust size", true)
self.druid:new_lang_text("text_locale", "ui_text_example") self.druid:new_lang_text("text_locale", "ui_text_example")