Update example with new brand one

This commit is contained in:
Insality
2024-10-17 01:24:15 +03:00
parent 2c762716bb
commit 91879509a0
197 changed files with 36779 additions and 7 deletions

View File

@@ -0,0 +1,36 @@
fonts {
name: "text_bold"
font: "/example/assets/fonts/text_bold.font"
}
nodes {
size {
x: 200.0
y: 100.0
}
type: TYPE_BOX
id: "root"
inherit_alpha: true
size_mode: SIZE_MODE_AUTO
visible: false
}
nodes {
size {
x: 700.0
y: 100.0
}
color {
x: 0.522
y: 0.522
z: 0.522
}
type: TYPE_TEXT
text: "Press \"SHIFT\" + \"X\" to trigger hotkey"
font: "text_bold"
id: "text"
parent: "root"
inherit_alpha: true
outline_alpha: 0.0
shadow_alpha: 0.0
}
material: "/builtins/materials/gui.material"
adjust_reference: ADJUST_REFERENCE_PARENT

View File

@@ -0,0 +1,29 @@
local hotkey = require("druid.extended.hotkey")
local component = require("druid.component")
---@class basic_hotkey: druid.base_component
---@field druid druid_instance
---@field root node
---@field text druid.text
local M = component.create("basic_hotkey")
---@param template string
---@param nodes table<hash, node>
function M:init(template, nodes)
self.druid = self:get_druid(template, nodes)
self.root = self:get_node("root")
self.hotkey = self.druid:new(hotkey, { "key_lshift", "key_x" }, self.on_hotkey)
end
function M:on_hotkey()
gui.animate(self.root, gui.PROP_SCALE, vmath.vector3(1.2), gui.EASING_OUTELASTIC, 0.5, 0, function()
gui.animate(self.root, gui.PROP_SCALE, vmath.vector3(1), gui.EASING_OUTELASTIC, 0.5)
end)
end
return M