mirror of
https://github.com/Insality/druid.git
synced 2025-06-27 02:17:52 +02:00
add simple example resources
This commit is contained in:
parent
c241f26ae1
commit
9d13837cf0
@ -35,3 +35,43 @@ embedded_instances {
|
||||
z: 1.0
|
||||
}
|
||||
}
|
||||
embedded_instances {
|
||||
id: "sounds"
|
||||
data: "embedded_components {\n"
|
||||
" id: \"click\"\n"
|
||||
" type: \"sound\"\n"
|
||||
" data: \"sound: \\\"/example/res/click.ogg\\\"\\n"
|
||||
"looping: 0\\n"
|
||||
"group: \\\"master\\\"\\n"
|
||||
"gain: 0.4\\n"
|
||||
"\"\n"
|
||||
" position {\n"
|
||||
" x: 0.0\n"
|
||||
" y: 0.0\n"
|
||||
" z: 0.0\n"
|
||||
" }\n"
|
||||
" rotation {\n"
|
||||
" x: 0.0\n"
|
||||
" y: 0.0\n"
|
||||
" z: 0.0\n"
|
||||
" w: 1.0\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
""
|
||||
position {
|
||||
x: 0.0
|
||||
y: 0.0
|
||||
z: 0.0
|
||||
}
|
||||
rotation {
|
||||
x: 0.0
|
||||
y: 0.0
|
||||
z: 0.0
|
||||
w: 1.0
|
||||
}
|
||||
scale3 {
|
||||
x: 1.0
|
||||
y: 1.0
|
||||
z: 1.0
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,11 @@
|
||||
script: "/example/example.gui.gui_script"
|
||||
fonts {
|
||||
name: "system_font"
|
||||
font: "/builtins/fonts/system_font.font"
|
||||
name: "game"
|
||||
font: "/example/game.font"
|
||||
}
|
||||
textures {
|
||||
name: "gui"
|
||||
texture: "/example/gui.atlas"
|
||||
}
|
||||
background_color {
|
||||
x: 0.0
|
||||
@ -23,14 +27,14 @@ nodes {
|
||||
w: 1.0
|
||||
}
|
||||
scale {
|
||||
x: 1.0
|
||||
y: 1.0
|
||||
x: 0.5
|
||||
y: 0.5
|
||||
z: 1.0
|
||||
w: 1.0
|
||||
}
|
||||
size {
|
||||
x: 200.0
|
||||
y: 100.0
|
||||
x: 426.0
|
||||
y: 190.0
|
||||
z: 0.0
|
||||
w: 1.0
|
||||
}
|
||||
@ -42,7 +46,7 @@ nodes {
|
||||
}
|
||||
type: TYPE_BOX
|
||||
blend_mode: BLEND_MODE_ALPHA
|
||||
texture: ""
|
||||
texture: "gui/green_long"
|
||||
id: "button_1"
|
||||
xanchor: XANCHOR_NONE
|
||||
yanchor: YANCHOR_NONE
|
||||
@ -66,7 +70,7 @@ nodes {
|
||||
nodes {
|
||||
position {
|
||||
x: 0.0
|
||||
y: 0.0
|
||||
y: 20.0
|
||||
z: 0.0
|
||||
w: 1.0
|
||||
}
|
||||
@ -77,8 +81,8 @@ nodes {
|
||||
w: 1.0
|
||||
}
|
||||
scale {
|
||||
x: 2.0
|
||||
y: 2.0
|
||||
x: 1.0
|
||||
y: 1.0
|
||||
z: 1.0
|
||||
w: 1.0
|
||||
}
|
||||
@ -89,15 +93,15 @@ nodes {
|
||||
w: 1.0
|
||||
}
|
||||
color {
|
||||
x: 0.0
|
||||
y: 0.0
|
||||
z: 0.0
|
||||
x: 1.0
|
||||
y: 1.0
|
||||
z: 1.0
|
||||
w: 1.0
|
||||
}
|
||||
type: TYPE_TEXT
|
||||
blend_mode: BLEND_MODE_ALPHA
|
||||
text: "Button 1"
|
||||
font: "system_font"
|
||||
font: "game"
|
||||
id: "text_1"
|
||||
xanchor: XANCHOR_NONE
|
||||
yanchor: YANCHOR_NONE
|
||||
@ -109,9 +113,9 @@ nodes {
|
||||
w: 1.0
|
||||
}
|
||||
shadow {
|
||||
x: 1.0
|
||||
y: 1.0
|
||||
z: 1.0
|
||||
x: 0.0
|
||||
y: 0.0
|
||||
z: 0.0
|
||||
w: 1.0
|
||||
}
|
||||
adjust_mode: ADJUST_MODE_FIT
|
||||
@ -140,14 +144,14 @@ nodes {
|
||||
w: 1.0
|
||||
}
|
||||
scale {
|
||||
x: 1.0
|
||||
y: 1.0
|
||||
x: 0.5
|
||||
y: 0.5
|
||||
z: 1.0
|
||||
w: 1.0
|
||||
}
|
||||
size {
|
||||
x: 200.0
|
||||
y: 100.0
|
||||
x: 426.0
|
||||
y: 190.0
|
||||
z: 0.0
|
||||
w: 1.0
|
||||
}
|
||||
@ -159,7 +163,7 @@ nodes {
|
||||
}
|
||||
type: TYPE_BOX
|
||||
blend_mode: BLEND_MODE_ALPHA
|
||||
texture: ""
|
||||
texture: "gui/green_long"
|
||||
id: "button_2"
|
||||
xanchor: XANCHOR_NONE
|
||||
yanchor: YANCHOR_NONE
|
||||
@ -183,7 +187,7 @@ nodes {
|
||||
nodes {
|
||||
position {
|
||||
x: 0.0
|
||||
y: 0.0
|
||||
y: 20.0
|
||||
z: 0.0
|
||||
w: 1.0
|
||||
}
|
||||
@ -194,8 +198,8 @@ nodes {
|
||||
w: 1.0
|
||||
}
|
||||
scale {
|
||||
x: 2.0
|
||||
y: 2.0
|
||||
x: 1.0
|
||||
y: 1.0
|
||||
z: 1.0
|
||||
w: 1.0
|
||||
}
|
||||
@ -206,15 +210,15 @@ nodes {
|
||||
w: 1.0
|
||||
}
|
||||
color {
|
||||
x: 0.0
|
||||
y: 0.0
|
||||
z: 0.0
|
||||
x: 1.0
|
||||
y: 1.0
|
||||
z: 1.0
|
||||
w: 1.0
|
||||
}
|
||||
type: TYPE_TEXT
|
||||
blend_mode: BLEND_MODE_ALPHA
|
||||
text: "Button 2"
|
||||
font: "system_font"
|
||||
font: "game"
|
||||
id: "text_2"
|
||||
xanchor: XANCHOR_NONE
|
||||
yanchor: YANCHOR_NONE
|
||||
@ -226,9 +230,9 @@ nodes {
|
||||
w: 1.0
|
||||
}
|
||||
shadow {
|
||||
x: 1.0
|
||||
y: 1.0
|
||||
z: 1.0
|
||||
x: 0.0
|
||||
y: 0.0
|
||||
z: 0.0
|
||||
w: 1.0
|
||||
}
|
||||
adjust_mode: ADJUST_MODE_FIT
|
||||
@ -257,14 +261,14 @@ nodes {
|
||||
w: 1.0
|
||||
}
|
||||
scale {
|
||||
x: 1.0
|
||||
y: 1.0
|
||||
x: 0.5
|
||||
y: 0.5
|
||||
z: 1.0
|
||||
w: 1.0
|
||||
}
|
||||
size {
|
||||
x: 200.0
|
||||
y: 100.0
|
||||
x: 426.0
|
||||
y: 190.0
|
||||
z: 0.0
|
||||
w: 1.0
|
||||
}
|
||||
@ -276,7 +280,7 @@ nodes {
|
||||
}
|
||||
type: TYPE_BOX
|
||||
blend_mode: BLEND_MODE_ALPHA
|
||||
texture: ""
|
||||
texture: "gui/green_long"
|
||||
id: "button_3"
|
||||
xanchor: XANCHOR_NONE
|
||||
yanchor: YANCHOR_NONE
|
||||
@ -300,7 +304,7 @@ nodes {
|
||||
nodes {
|
||||
position {
|
||||
x: 0.0
|
||||
y: 0.0
|
||||
y: 20.0
|
||||
z: 0.0
|
||||
w: 1.0
|
||||
}
|
||||
@ -311,8 +315,8 @@ nodes {
|
||||
w: 1.0
|
||||
}
|
||||
scale {
|
||||
x: 2.0
|
||||
y: 2.0
|
||||
x: 1.0
|
||||
y: 1.0
|
||||
z: 1.0
|
||||
w: 1.0
|
||||
}
|
||||
@ -323,15 +327,15 @@ nodes {
|
||||
w: 1.0
|
||||
}
|
||||
color {
|
||||
x: 0.0
|
||||
y: 0.0
|
||||
z: 0.0
|
||||
x: 1.0
|
||||
y: 1.0
|
||||
z: 1.0
|
||||
w: 1.0
|
||||
}
|
||||
type: TYPE_TEXT
|
||||
blend_mode: BLEND_MODE_ALPHA
|
||||
text: "Button 3"
|
||||
font: "system_font"
|
||||
font: "game"
|
||||
id: "text_3"
|
||||
xanchor: XANCHOR_NONE
|
||||
yanchor: YANCHOR_NONE
|
||||
@ -343,9 +347,9 @@ nodes {
|
||||
w: 1.0
|
||||
}
|
||||
shadow {
|
||||
x: 1.0
|
||||
y: 1.0
|
||||
z: 1.0
|
||||
x: 0.0
|
||||
y: 0.0
|
||||
z: 0.0
|
||||
w: 1.0
|
||||
}
|
||||
adjust_mode: ADJUST_MODE_FIT
|
||||
|
@ -1,8 +1,17 @@
|
||||
local druid = require "druid.druid"
|
||||
local druid = require("druid.druid")
|
||||
local druid_settings = require("druid.settings")
|
||||
|
||||
local function setup_druid(self)
|
||||
druid_settings.play_sound = function(name)
|
||||
sound.play("sounds#" .. name)
|
||||
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)
|
||||
|
17
example/game.font
Normal file
17
example/game.font
Normal file
@ -0,0 +1,17 @@
|
||||
font: "/example/res/exo2.ttf"
|
||||
material: "/builtins/fonts/font.material"
|
||||
size: 64
|
||||
antialias: 1
|
||||
alpha: 1.0
|
||||
outline_alpha: 0.0
|
||||
outline_width: 0.0
|
||||
shadow_alpha: 1.0
|
||||
shadow_blur: 0
|
||||
shadow_x: 3.0
|
||||
shadow_y: -5.0
|
||||
extra_characters: ""
|
||||
output_format: TYPE_BITMAP
|
||||
all_chars: false
|
||||
cache_width: 0
|
||||
cache_height: 0
|
||||
render_mode: MODE_MULTI_LAYER
|
9
example/gui.atlas
Normal file
9
example/gui.atlas
Normal file
@ -0,0 +1,9 @@
|
||||
images {
|
||||
image: "/example/res/gray_long.png"
|
||||
}
|
||||
images {
|
||||
image: "/example/res/green_long.png"
|
||||
}
|
||||
margin: 0
|
||||
extrude_borders: 0
|
||||
inner_padding: 0
|
BIN
example/res/click.ogg
Executable file
BIN
example/res/click.ogg
Executable file
Binary file not shown.
BIN
example/res/exo2.ttf
Executable file
BIN
example/res/exo2.ttf
Executable file
Binary file not shown.
BIN
example/res/gray_long.png
Normal file
BIN
example/res/gray_long.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
example/res/green_long.png
Normal file
BIN
example/res/green_long.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
Loading…
x
Reference in New Issue
Block a user