Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new example scene to example-v4
- Loading branch information
1 parent
fa1a143
commit 703bff3
Showing
9 changed files
with
303 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
spine-godot/example-v4/assets/celestial-circus/celestial-circus-data.tres
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[gd_resource type="SpineSkeletonDataResource" load_steps=3 format=3 uid="uid://d1ordmjpe5kt7"] | ||
|
||
[ext_resource type="SpineAtlasResource" uid="uid://syvy0bxbnwgi" path="res://assets/celestial-circus/celestial-circus.atlas" id="1_fs1an"] | ||
[ext_resource type="SpineSkeletonFileResource" uid="uid://doan7yl2by7vm" path="res://assets/celestial-circus/celestial-circus.skel" id="2_sbom4"] | ||
|
||
[resource] | ||
atlas_res = ExtResource("1_fs1an") | ||
skeleton_file_res = ExtResource("2_sbom4") |
169 changes: 169 additions & 0 deletions
169
spine-godot/example-v4/assets/celestial-circus/celestial-circus.atlas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
celestial-circus.png | ||
size:984,1032 | ||
filter:Linear,Linear | ||
scale:0.4 | ||
arm-back-down | ||
bounds:774,7,38,82 | ||
rotate:90 | ||
arm-back-up | ||
bounds:819,437,83,116 | ||
rotate:90 | ||
arm-front-down | ||
bounds:863,49,36,78 | ||
arm-front-up | ||
bounds:784,47,77,116 | ||
bench | ||
bounds:798,668,189,48 | ||
rotate:90 | ||
body-bottom | ||
bounds:724,165,154,124 | ||
rotate:90 | ||
body-top | ||
bounds:819,522,126,132 | ||
offsets:0,0,126,133 | ||
chest | ||
bounds:848,656,104,93 | ||
rotate:90 | ||
cloud-back | ||
bounds:520,154,202,165 | ||
cloud-front | ||
bounds:492,411,325,196 | ||
collar | ||
bounds:935,108,47,26 | ||
ear | ||
bounds:462,789,20,28 | ||
rotate:90 | ||
eye-back-shadow | ||
bounds:947,522,14,10 | ||
rotate:90 | ||
eye-front-shadow | ||
bounds:819,411,24,14 | ||
rotate:90 | ||
eye-reflex-back | ||
bounds:774,55,8,7 | ||
eye-reflex-front | ||
bounds:841,321,10,7 | ||
rotate:90 | ||
eye-white-back | ||
bounds:214,322,13,16 | ||
rotate:90 | ||
eye-white-front | ||
bounds:348,2,22,17 | ||
rotate:90 | ||
eyelashes-down-back | ||
bounds:214,314,11,6 | ||
eyelashes-down-front | ||
bounds:943,721,15,6 | ||
rotate:90 | ||
eyelashes-top-back | ||
bounds:816,656,18,10 | ||
eyelashes-top-front | ||
bounds:798,636,30,16 | ||
rotate:90 | ||
face | ||
bounds:841,333,91,102 | ||
offsets:2,0,93,102 | ||
feathers-back | ||
bounds:444,811,46,46 | ||
feathers-front | ||
bounds:767,323,72,86 | ||
fringe-middle-back | ||
bounds:929,54,33,52 | ||
fringe-middle-front | ||
bounds:575,2,60,50 | ||
rotate:90 | ||
fringe-side-back | ||
bounds:848,763,27,94 | ||
fringe-side-front | ||
bounds:901,34,26,93 | ||
glove-bottom-back | ||
bounds:941,403,51,41 | ||
rotate:90 | ||
glove-bottom-front | ||
bounds:935,136,47,48 | ||
hair-back-1 | ||
bounds:214,6,132,306 | ||
hair-back-2 | ||
bounds:438,27,80,285 | ||
hair-back-3 | ||
bounds:879,762,70,268 | ||
hair-back-4 | ||
bounds:520,64,88,262 | ||
rotate:90 | ||
hair-back-5 | ||
bounds:486,321,88,279 | ||
rotate:90 | ||
hair-back-6 | ||
bounds:348,26,88,286 | ||
hair-hat-shadow | ||
bounds:850,186,89,41 | ||
offsets:1,0,90,41 | ||
hand-back | ||
bounds:627,2,60,47 | ||
rotate:90 | ||
hand-front | ||
bounds:520,2,53,60 | ||
hat-back | ||
bounds:937,456,64,45 | ||
rotate:90 | ||
hat-front | ||
bounds:676,6,96,56 | ||
head-back | ||
bounds:850,229,102,86 | ||
rotate:90 | ||
jabot | ||
bounds:863,129,70,55 | ||
leg-back | ||
bounds:2,2,210,333 | ||
leg-front | ||
bounds:232,462,258,320 | ||
logo-brooch | ||
bounds:444,784,16,25 | ||
mouth | ||
bounds:943,738,22,6 | ||
rotate:90 | ||
neck | ||
bounds:938,278,39,56 | ||
nose | ||
bounds:943,712,6,7 | ||
nose-highlight | ||
bounds:486,456,4,4 | ||
nose-shadow | ||
bounds:724,155,7,8 | ||
pupil-back | ||
bounds:972,228,10,14 | ||
pupil-front | ||
bounds:964,94,12,18 | ||
rotate:90 | ||
rope-back | ||
bounds:951,538,10,492 | ||
rope-front | ||
bounds:951,538,10,492 | ||
rope-front-bottom | ||
bounds:934,336,42,65 | ||
skirt | ||
bounds:2,784,440,246 | ||
sock-bow | ||
bounds:938,244,33,32 | ||
spine-logo-body | ||
bounds:938,229,13,32 | ||
rotate:90 | ||
star-big | ||
bounds:963,1007,17,23 | ||
offsets:1,0,18,24 | ||
star-medium | ||
bounds:774,47,6,8 | ||
rotate:90 | ||
star-small | ||
bounds:462,784,3,4 | ||
rotate:90 | ||
underskirt | ||
bounds:2,337,445,228 | ||
rotate:90 | ||
underskirt-back | ||
bounds:444,859,433,171 | ||
wing-back | ||
bounds:232,314,146,252 | ||
rotate:90 | ||
wing-front | ||
bounds:492,609,304,248 |
15 changes: 15 additions & 0 deletions
15
spine-godot/example-v4/assets/celestial-circus/celestial-circus.atlas.import
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[remap] | ||
|
||
importer="spine.atlas" | ||
type="SpineAtlasResource" | ||
uid="uid://syvy0bxbnwgi" | ||
path="res://.godot/imported/celestial-circus.atlas-8277f39286d729eed930dc8584632c9d.spatlas" | ||
|
||
[deps] | ||
|
||
source_file="res://assets/celestial-circus/celestial-circus.atlas" | ||
dest_files=["res://.godot/imported/celestial-circus.atlas-8277f39286d729eed930dc8584632c9d.spatlas"] | ||
|
||
[params] | ||
|
||
normal_map_prefix="n" |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions
34
spine-godot/example-v4/assets/celestial-circus/celestial-circus.png.import
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="CompressedTexture2D" | ||
uid="uid://d27f2nxof5i18" | ||
path="res://.godot/imported/celestial-circus.png-362082edc9ee92c57423ee448ab8be8a.ctex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://assets/celestial-circus/celestial-circus.png" | ||
dest_files=["res://.godot/imported/celestial-circus.png-362082edc9ee92c57423ee448ab8be8a.ctex"] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/high_quality=false | ||
compress/lossy_quality=0.7 | ||
compress/hdr_compression=1 | ||
compress/normal_map=0 | ||
compress/channel_pack=0 | ||
mipmaps/generate=false | ||
mipmaps/limit=-1 | ||
roughness/mode=0 | ||
roughness/src_normal="" | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/normal_map_invert_y=false | ||
process/hdr_as_srgb=false | ||
process/hdr_clamp_exposure=false | ||
process/size_limit=0 | ||
detect_3d/compress_to=1 |
Binary file not shown.
14 changes: 14 additions & 0 deletions
14
spine-godot/example-v4/assets/celestial-circus/celestial-circus.skel.import
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[remap] | ||
|
||
importer="spine.skel" | ||
type="SpineSkeletonFileResource" | ||
uid="uid://doan7yl2by7vm" | ||
path="res://.godot/imported/celestial-circus.skel-57e15df02c4ab2ec1bbb6a38273235f3.spskel" | ||
|
||
[deps] | ||
|
||
source_file="res://assets/celestial-circus/celestial-circus.skel" | ||
dest_files=["res://.godot/imported/celestial-circus.skel-57e15df02c4ab2ec1bbb6a38273235f3.spskel"] | ||
|
||
[params] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
extends Node2D | ||
|
||
@onready var celestial_circus: SpineSprite = $"celestial-circus" | ||
|
||
var last_x = -1 | ||
var last_y = -1 | ||
var isMouseOver = false | ||
|
||
func _ready(): | ||
celestial_circus.get_animation_state().set_animation("wind-idle", true, 0) | ||
celestial_circus.get_animation_state().set_animation("eyeblink-long", true, 1) | ||
celestial_circus.get_animation_state().set_animation("stars", true, 2) | ||
|
||
func _process(_delta): | ||
if (Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT) and isMouseOver): | ||
var pos = get_viewport().get_mouse_position() | ||
if (last_x != -1): | ||
var dx = pos.x - last_x | ||
var dy = pos.y - last_y | ||
celestial_circus.global_position += Vector2(dx, dy) | ||
celestial_circus.get_skeleton().physics_translate(dx * 1 / celestial_circus.scale.x, dy * 1 / celestial_circus.scale.y) | ||
last_x = pos.x | ||
last_y = pos.y | ||
else: | ||
last_x = -1 | ||
last_y = -1 | ||
|
||
func _on_area_2d_mouse_entered(): | ||
isMouseOver = true | ||
|
||
func _on_area_2d_mouse_exited(): | ||
isMouseOver = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
[gd_scene load_steps=4 format=3 uid="uid://re2mg31p3vln"] | ||
|
||
[ext_resource type="Script" path="res://examples/12-physics/physics.gd" id="1_7guqn"] | ||
[ext_resource type="SpineSkeletonDataResource" uid="uid://d1ordmjpe5kt7" path="res://assets/celestial-circus/celestial-circus-data.tres" id="2_t2blj"] | ||
|
||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_do8w3"] | ||
size = Vector2(270, 573) | ||
|
||
[node name="Node2D" type="Node2D"] | ||
script = ExtResource("1_7guqn") | ||
|
||
[node name="celestial-circus" type="SpineSprite" parent="."] | ||
position = Vector2(600, 485) | ||
scale = Vector2(0.25, 0.25) | ||
skeleton_data_res = ExtResource("2_t2blj") | ||
preview_skin = "Default" | ||
preview_animation = "-- Empty --" | ||
preview_frame = false | ||
preview_time = 0.0 | ||
|
||
[node name="Area2D" type="Area2D" parent="celestial-circus"] | ||
show_behind_parent = true | ||
scale = Vector2(4, 4) | ||
|
||
[node name="CollisionShape2D" type="CollisionShape2D" parent="celestial-circus/Area2D"] | ||
show_behind_parent = true | ||
position = Vector2(0, -158.5) | ||
shape = SubResource("RectangleShape2D_do8w3") | ||
|
||
[connection signal="mouse_entered" from="celestial-circus/Area2D" to="." method="_on_area_2d_mouse_entered"] | ||
[connection signal="mouse_exited" from="celestial-circus/Area2D" to="." method="_on_area_2d_mouse_exited"] |