mirror of
https://github.com/enduro2d/enduro2d.git
synced 2025-12-14 08:07:17 +07:00
render impl for sliced sprites
This commit is contained in:
12
samples/bin/library/prefabs/panel_prefab.json
Normal file
12
samples/bin/library/prefabs/panel_prefab.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"prototype" : "sprite_prefab.json",
|
||||
"components" : {
|
||||
"named" : {
|
||||
"name" : "panel"
|
||||
},
|
||||
"sprite_renderer" : {
|
||||
"mode" : "sliced",
|
||||
"sprite" : "../sprites/panel_sprite.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,60 +5,65 @@
|
||||
},{
|
||||
"prototype" : "../prefabs/camera_prefab.json"
|
||||
},{
|
||||
"prototype" : "../prefabs/layout_prefab.json",
|
||||
"prototype" : "../prefabs/panel_prefab.json",
|
||||
"components" : {
|
||||
"actor" : {
|
||||
"translation" : [-250,0]
|
||||
},
|
||||
"layout" : {
|
||||
"size" : [500,200],
|
||||
"halign" : "space_evenly"
|
||||
"sprite_renderer" : {
|
||||
"scale" : [4,2]
|
||||
}
|
||||
},
|
||||
"children" : [{
|
||||
"prototype" : "../prefabs/layout_prefab.json",
|
||||
"components" : {
|
||||
"layout" : {
|
||||
"size" : [66,113]
|
||||
"size" : [400,200],
|
||||
"halign" : "space_evenly"
|
||||
}
|
||||
},
|
||||
"children" : [{
|
||||
"prototype" : "../prefabs/ship_prefab.json",
|
||||
"prototype" : "../prefabs/layout_prefab.json",
|
||||
"components" : {
|
||||
"actor" : {
|
||||
"translation" : [33,56.5]
|
||||
"layout" : {
|
||||
"size" : [66,113]
|
||||
}
|
||||
}
|
||||
}]
|
||||
},{
|
||||
"prototype" : "../prefabs/layout_prefab.json",
|
||||
"components" : {
|
||||
"layout" : {
|
||||
"size" : [66,113]
|
||||
}
|
||||
},
|
||||
"children" : [{
|
||||
"prototype" : "../prefabs/ship_prefab.json",
|
||||
},
|
||||
"children" : [{
|
||||
"prototype" : "../prefabs/ship_prefab.json",
|
||||
"components" : {
|
||||
"actor" : {
|
||||
"translation" : [33,56.5]
|
||||
}
|
||||
}
|
||||
}]
|
||||
},{
|
||||
"prototype" : "../prefabs/layout_prefab.json",
|
||||
"components" : {
|
||||
"actor" : {
|
||||
"translation" : [33,56.5]
|
||||
"layout" : {
|
||||
"size" : [66,113]
|
||||
}
|
||||
}
|
||||
}]
|
||||
},{
|
||||
"prototype" : "../prefabs/layout_prefab.json",
|
||||
"components" : {
|
||||
"layout" : {
|
||||
"size" : [66,113]
|
||||
}
|
||||
},
|
||||
"children" : [{
|
||||
"prototype" : "../prefabs/ship_prefab.json",
|
||||
},
|
||||
"children" : [{
|
||||
"prototype" : "../prefabs/ship_prefab.json",
|
||||
"components" : {
|
||||
"actor" : {
|
||||
"translation" : [33,56.5]
|
||||
}
|
||||
}
|
||||
}]
|
||||
},{
|
||||
"prototype" : "../prefabs/layout_prefab.json",
|
||||
"components" : {
|
||||
"actor" : {
|
||||
"translation" : [33,56.5]
|
||||
"layout" : {
|
||||
"size" : [66,113]
|
||||
}
|
||||
}
|
||||
},
|
||||
"children" : [{
|
||||
"prototype" : "../prefabs/ship_prefab.json",
|
||||
"components" : {
|
||||
"actor" : {
|
||||
"translation" : [33,56.5]
|
||||
}
|
||||
}
|
||||
}]
|
||||
}]
|
||||
}]
|
||||
}]
|
||||
|
||||
3
samples/bin/library/sprites/panel.png
Normal file
3
samples/bin/library/sprites/panel.png
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0ebc16b176a3982ee84be2ad86a3d0ceb5790479c90394e183a9a2b8e9c7bc6a
|
||||
size 625
|
||||
6
samples/bin/library/sprites/panel_sprite.json
Normal file
6
samples/bin/library/sprites/panel_sprite.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"texture" : "panel.png",
|
||||
"pivot" : { "x" : 0, "y" : 0 },
|
||||
"inner_texrect" : { "x" : 6, "y" : 6, "w" : 88, "h" : 88 },
|
||||
"outer_texrect" : { "x" : 0, "y" : 0, "w" : 100, "h" : 100 }
|
||||
}
|
||||
Reference in New Issue
Block a user