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,257 @@
fonts {
name: "text_bold"
font: "/example/assets/fonts/text_bold.font"
}
fonts {
name: "text_regular"
font: "/example/assets/fonts/text_regular.font"
}
textures {
name: "druid"
texture: "/example/assets/druid.atlas"
}
textures {
name: "druid_logo"
texture: "/example/assets/druid_logo.atlas"
}
nodes {
size {
x: 600.0
y: 1000.0
}
color {
x: 0.173
y: 0.184
z: 0.204
}
type: TYPE_BOX
texture: "druid/ui_circle_64"
id: "root"
inherit_alpha: true
slice9 {
x: 32.0
y: 32.0
z: 32.0
w: 32.0
}
}
nodes {
position {
x: -180.0
y: 375.0
}
type: TYPE_BOX
texture: "druid_logo/icon_druid"
id: "icon_druid_left"
parent: "root"
layer: "druid_logo"
inherit_alpha: true
alpha: 0.75
size_mode: SIZE_MODE_AUTO
}
nodes {
position {
x: 180.0
y: 375.0
}
type: TYPE_BOX
texture: "druid_logo/icon_druid"
id: "icon_druid_right"
parent: "root"
layer: "druid_logo"
inherit_alpha: true
alpha: 0.75
size_mode: SIZE_MODE_AUTO
}
nodes {
position {
y: 255.0
}
scale {
x: 2.0
y: 2.0
}
size {
x: 200.0
y: 40.0
}
color {
x: 0.941
y: 0.984
}
type: TYPE_TEXT
text: "Hello!"
font: "text_bold"
id: "text_hello"
parent: "root"
inherit_alpha: true
outline_alpha: 0.0
shadow_alpha: 0.0
}
nodes {
position {
x: -210.0
y: 191.0
}
scale {
x: 0.7
y: 0.7
}
size {
x: 600.0
y: 400.0
}
color {
x: 0.525
y: 0.525
z: 0.525
}
type: TYPE_TEXT
text: "Welcome to Druid Example Page\n"
"\n"
"Navigate over examples on the left\n"
"\n"
"Check example info on the right"
font: "text_bold"
id: "text_description"
pivot: PIVOT_NW
line_break: true
parent: "root"
inherit_alpha: true
outline_alpha: 0.0
shadow_alpha: 0.0
}
nodes {
position {
x: -210.0
y: -189.0
}
scale {
x: 0.7
y: 0.7
}
size {
x: 600.0
y: 300.0
}
color {
x: 0.525
y: 0.525
z: 0.525
}
type: TYPE_TEXT
text: "Your donation helps me stay engaged in creating valuable projects for Defold.\n"
"\n"
"If you appreciate what I\'m doing, please consider supporting me!"
font: "text_bold"
id: "text_support"
pivot: PIVOT_W
line_break: true
parent: "root"
inherit_alpha: true
outline_alpha: 0.0
shadow_alpha: 0.0
}
nodes {
position {
x: -170.0
y: -364.0
}
type: TYPE_BOX
texture: "druid/icon_heart"
id: "icon_heart1"
parent: "root"
inherit_alpha: true
alpha: 0.75
size_mode: SIZE_MODE_AUTO
}
nodes {
position {
y: -364.0
}
type: TYPE_BOX
texture: "druid/icon_heart"
id: "icon_heart2"
parent: "root"
inherit_alpha: true
alpha: 0.75
size_mode: SIZE_MODE_AUTO
}
nodes {
position {
x: 170.0
y: -364.0
}
type: TYPE_BOX
texture: "druid/icon_heart"
id: "icon_heart3"
parent: "root"
inherit_alpha: true
alpha: 0.75
size_mode: SIZE_MODE_AUTO
}
nodes {
position {
y: -450.0
}
size {
x: 500.0
y: 80.0
}
type: TYPE_BOX
id: "sponsor"
parent: "root"
inherit_alpha: true
size_mode: SIZE_MODE_AUTO
visible: false
}
nodes {
position {
x: -196.0
y: -3.0
}
type: TYPE_BOX
texture: "druid_logo/sponsor_github"
id: "sponsor_github"
parent: "sponsor"
layer: "druid_logo"
inherit_alpha: true
alpha: 0.75
size_mode: SIZE_MODE_AUTO
}
nodes {
position {
x: 21.0
y: -3.0
}
type: TYPE_BOX
texture: "druid_logo/sponsor_coffee"
id: "sponsor_coffee"
parent: "sponsor"
layer: "druid_logo"
inherit_alpha: true
alpha: 0.75
size_mode: SIZE_MODE_AUTO
}
nodes {
position {
x: 217.0
y: -3.0
}
type: TYPE_BOX
texture: "druid_logo/sponsor_kofi"
id: "sponsor_kofi"
parent: "sponsor"
layer: "druid_logo"
inherit_alpha: true
alpha: 0.75
size_mode: SIZE_MODE_AUTO
}
layers {
name: "druid_logo"
}
layers {
name: "text_regular"
}
material: "/builtins/materials/gui.material"
adjust_reference: ADJUST_REFERENCE_PARENT

View File

@@ -0,0 +1,40 @@
local component = require("druid.component")
local rich_text = require("druid.custom.rich_text.rich_text")
local layout = require("druid.extended.layout")
local panthera = require("panthera.panthera")
local intro_panthera = require("example.examples.intro.intro.intro_panthera")
---@class intro: druid.base_component
---@field druid druid_instance
---@field root node
local M = component.create("intro")
---@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.druid:new(rich_text, "text_hello", "He<color=#E48155>ll</color>o!")
self.druid:new_button("sponsor_github", self.open_link, "https://github.com/sponsors/insality")
self.druid:new_button("sponsor_coffee", self.open_link, "https://www.buymeacoffee.com/insality")
self.druid:new_button("sponsor_kofi", self.open_link, "https://ko-fi.com/insality")
self.druid:new(layout, "sponsor")
:add("sponsor_github")
:add("sponsor_coffee")
:add("sponsor_kofi")
:set_margin(8, 0)
self.animation = panthera.create_gui(intro_panthera, self:get_template(), nodes)
panthera.play(self.animation, "idle", { is_loop = true })
end
function M:open_link(link)
sys.open_url(link, { target = "_blank" })
end
return M

View File

@@ -0,0 +1,560 @@
return {
version = 1,
format = "json",
type = "animation_editor",
data = {
metadata = {
fps = 60,
layers = {
{
name = "druid_logo",
color = "73E84C",
},
{
name = "text_regular",
color = "90D2F6",
},
},
gui_path = "/example/examples/intro/intro/intro.gui",
settings = {
font_size = 40,
},
gizmo_steps = {
},
},
nodes = {
},
animations = {
{
animation_id = "default",
duration = 1,
animation_keys = {
},
},
{
animation_id = "idle",
duration = 10,
animation_keys = {
{
node_id = "icon_druid_left",
property_id = "position_y",
duration = 2,
easing = "outsine",
start_value = 375,
key_type = "tween",
end_value = 370,
},
{
node_id = "icon_druid_right",
property_id = "position_y",
duration = 2,
easing = "outsine",
start_value = 375,
key_type = "tween",
end_value = 370,
},
{
end_value = 0.737,
node_id = "icon_heart1",
property_id = "color_b",
duration = 0.7,
easing = "outsine",
start_value = 1,
key_type = "tween",
start_time = 0.7,
},
{
end_value = 0.38,
node_id = "icon_heart1",
property_id = "color_g",
duration = 0.7,
easing = "outsine",
start_value = 1,
key_type = "tween",
start_time = 0.7,
},
{
end_value = 0.941,
node_id = "icon_heart1",
property_id = "color_r",
duration = 0.7,
easing = "outsine",
start_value = 1,
key_type = "tween",
start_time = 0.7,
},
{
end_value = 1,
node_id = "icon_heart1",
property_id = "color_a",
duration = 0.7,
easing = "outsine",
start_value = 0.75,
key_type = "tween",
start_time = 0.7,
},
{
end_value = 1.1,
node_id = "icon_heart1",
property_id = "scale_x",
duration = 0.7,
easing = "outsine",
start_value = 1,
key_type = "tween",
start_time = 0.7,
},
{
end_value = 1.1,
node_id = "icon_heart1",
property_id = "scale_y",
duration = 0.7,
easing = "outsine",
start_value = 1,
key_type = "tween",
start_time = 0.7,
},
{
end_value = 1.2,
node_id = "sponsor_github",
property_id = "color_a",
start_value = 0.75,
easing = "outsine",
duration = 0.7,
key_type = "tween",
start_time = 0.7,
},
{
end_value = 0.75,
node_id = "icon_heart1",
property_id = "color_a",
duration = 1,
easing = "insine",
start_value = 1,
key_type = "tween",
start_time = 1.4,
},
{
end_value = 1,
node_id = "icon_heart1",
property_id = "color_b",
duration = 1,
easing = "insine",
start_value = 0.737,
key_type = "tween",
start_time = 1.4,
},
{
end_value = 1,
node_id = "icon_heart1",
property_id = "color_g",
duration = 1,
easing = "insine",
start_value = 0.38,
key_type = "tween",
start_time = 1.4,
},
{
end_value = 1,
node_id = "icon_heart1",
property_id = "color_r",
duration = 1,
easing = "insine",
start_value = 0.941,
key_type = "tween",
start_time = 1.4,
},
{
end_value = 1,
node_id = "icon_heart1",
property_id = "scale_x",
duration = 1,
easing = "insine",
start_value = 1.1,
key_type = "tween",
start_time = 1.4,
},
{
end_value = 1,
node_id = "icon_heart1",
property_id = "scale_y",
duration = 1,
easing = "insine",
start_value = 1.1,
key_type = "tween",
start_time = 1.4,
},
{
end_value = 1,
node_id = "sponsor_github",
property_id = "color_a",
start_value = 1.2,
easing = "insine",
duration = 1,
key_type = "tween",
start_time = 1.4,
},
{
end_value = 380,
node_id = "icon_druid_left",
property_id = "position_y",
duration = 2.5,
easing = "outsine",
start_value = 370,
key_type = "tween",
start_time = 2,
},
{
end_value = 380,
node_id = "icon_druid_right",
property_id = "position_y",
duration = 2.5,
easing = "outsine",
start_value = 370,
key_type = "tween",
start_time = 2,
},
{
end_value = 0.353,
node_id = "icon_heart2",
property_id = "color_b",
duration = 0.7,
easing = "outsine",
start_value = 1,
key_type = "tween",
start_time = 3.7,
},
{
end_value = 1,
node_id = "icon_heart2",
property_id = "color_g",
duration = 0.7,
easing = "outsine",
start_value = 1,
key_type = "tween",
start_time = 3.7,
},
{
end_value = 1,
node_id = "icon_heart2",
property_id = "color_r",
duration = 0.7,
easing = "outsine",
start_value = 1,
key_type = "tween",
start_time = 3.7,
},
{
end_value = 1,
node_id = "icon_heart2",
property_id = "color_a",
duration = 0.7,
easing = "outsine",
start_value = 0.75,
key_type = "tween",
start_time = 3.7,
},
{
end_value = 1.1,
node_id = "icon_heart2",
property_id = "scale_x",
duration = 0.7,
easing = "outsine",
start_value = 1,
key_type = "tween",
start_time = 3.7,
},
{
end_value = 1.1,
node_id = "icon_heart2",
property_id = "scale_y",
duration = 0.7,
easing = "outsine",
start_value = 1,
key_type = "tween",
start_time = 3.7,
},
{
end_value = 1.2,
node_id = "sponsor_coffee",
property_id = "color_a",
duration = 0.7,
easing = "outsine",
start_value = 0.75,
key_type = "tween",
start_time = 3.7,
},
{
end_value = 1.2,
node_id = "icon_druid_left",
property_id = "color_a",
duration = 0.35,
easing = "outsine",
start_value = 0.75,
key_type = "tween",
start_time = 4.15,
},
{
end_value = 1.2,
node_id = "icon_druid_right",
property_id = "color_a",
duration = 0.35,
easing = "outsine",
start_value = 0.75,
key_type = "tween",
start_time = 4.15,
},
{
end_value = 0.75,
node_id = "icon_heart2",
property_id = "color_a",
duration = 1,
easing = "insine",
start_value = 1,
key_type = "tween",
start_time = 4.4,
},
{
end_value = 1,
node_id = "icon_heart2",
property_id = "color_b",
duration = 1,
easing = "insine",
start_value = 0.353,
key_type = "tween",
start_time = 4.4,
},
{
end_value = 1,
node_id = "icon_heart2",
property_id = "color_g",
duration = 1,
easing = "insine",
start_value = 1,
key_type = "tween",
start_time = 4.4,
},
{
end_value = 1,
node_id = "icon_heart2",
property_id = "color_r",
duration = 1,
easing = "insine",
start_value = 1,
key_type = "tween",
start_time = 4.4,
},
{
end_value = 1,
node_id = "icon_heart2",
property_id = "scale_x",
duration = 1,
easing = "insine",
start_value = 1.1,
key_type = "tween",
start_time = 4.4,
},
{
end_value = 1,
node_id = "icon_heart2",
property_id = "scale_y",
duration = 1,
easing = "insine",
start_value = 1.1,
key_type = "tween",
start_time = 4.4,
},
{
end_value = 1,
node_id = "sponsor_coffee",
property_id = "color_a",
duration = 1,
easing = "insine",
start_value = 1.2,
key_type = "tween",
start_time = 4.4,
},
{
end_value = 0.75,
node_id = "icon_druid_left",
property_id = "color_a",
duration = 1.15,
easing = "outsine",
start_value = 1.2,
key_type = "tween",
start_time = 4.5,
},
{
end_value = 0.75,
node_id = "icon_druid_right",
property_id = "color_a",
duration = 1.15,
easing = "outsine",
start_value = 1.2,
key_type = "tween",
start_time = 4.5,
},
{
end_value = 375,
node_id = "icon_druid_left",
property_id = "position_y",
duration = 5.5,
easing = "insine",
start_value = 380,
key_type = "tween",
start_time = 4.5,
},
{
end_value = 375,
node_id = "icon_druid_right",
property_id = "position_y",
duration = 5.5,
easing = "insine",
start_value = 380,
key_type = "tween",
start_time = 4.5,
},
{
end_value = 0.478,
node_id = "icon_heart3",
property_id = "color_b",
duration = 0.7,
easing = "outsine",
start_value = 1,
key_type = "tween",
start_time = 6.7,
},
{
end_value = 0.494,
node_id = "icon_heart3",
property_id = "color_g",
duration = 0.7,
easing = "outsine",
start_value = 1,
key_type = "tween",
start_time = 6.7,
},
{
end_value = 1,
node_id = "icon_heart3",
property_id = "color_r",
duration = 0.7,
easing = "outsine",
start_value = 1,
key_type = "tween",
start_time = 6.7,
},
{
end_value = 1,
node_id = "icon_heart3",
property_id = "color_a",
duration = 0.7,
easing = "outsine",
start_value = 0.75,
key_type = "tween",
start_time = 6.7,
},
{
end_value = 1.1,
node_id = "icon_heart3",
property_id = "scale_x",
duration = 0.7,
easing = "outsine",
start_value = 1,
key_type = "tween",
start_time = 6.7,
},
{
end_value = 1.1,
node_id = "icon_heart3",
property_id = "scale_y",
duration = 0.7,
easing = "outsine",
start_value = 1,
key_type = "tween",
start_time = 6.7,
},
{
end_value = 1.2,
node_id = "sponsor_kofi",
property_id = "color_a",
duration = 0.7,
easing = "outsine",
start_value = 0.75,
key_type = "tween",
start_time = 6.7,
},
{
end_value = 0.75,
node_id = "icon_heart3",
property_id = "color_a",
duration = 1,
easing = "insine",
start_value = 1,
key_type = "tween",
start_time = 7.4,
},
{
end_value = 1,
node_id = "icon_heart3",
property_id = "color_b",
duration = 1,
easing = "insine",
start_value = 0.478,
key_type = "tween",
start_time = 7.4,
},
{
end_value = 1,
node_id = "icon_heart3",
property_id = "color_g",
duration = 1,
easing = "insine",
start_value = 0.494,
key_type = "tween",
start_time = 7.4,
},
{
end_value = 1,
node_id = "icon_heart3",
property_id = "color_r",
duration = 1,
easing = "insine",
start_value = 1,
key_type = "tween",
start_time = 7.4,
},
{
end_value = 1,
node_id = "icon_heart3",
property_id = "scale_x",
duration = 1,
easing = "insine",
start_value = 1.1,
key_type = "tween",
start_time = 7.4,
},
{
end_value = 1,
node_id = "icon_heart3",
property_id = "scale_y",
duration = 1,
easing = "insine",
start_value = 1.1,
key_type = "tween",
start_time = 7.4,
},
{
end_value = 1,
node_id = "sponsor_kofi",
property_id = "color_a",
duration = 1,
easing = "insine",
start_value = 1.2,
key_type = "tween",
start_time = 7.4,
},
},
},
},
},
}