Skip to content

Commit

Permalink
Add a new example scene to example
Browse files Browse the repository at this point in the history
  • Loading branch information
misaki-eymard committed Apr 9, 2024
1 parent 7fa84d8 commit 0721405
Show file tree
Hide file tree
Showing 9 changed files with 305 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[gd_resource type="SpineSkeletonDataResource" load_steps=3 format=2]

[ext_resource path="res://assets/celestial-circus/celestial-circus.skel" type="SpineSkeletonFileResource" id=1]
[ext_resource path="res://assets/celestial-circus/celestial-circus.atlas" type="SpineAtlasResource" id=2]

[resource]
atlas_res = ExtResource( 2 )
skeleton_file_res = ExtResource( 1 )
169 changes: 169 additions & 0 deletions spine-godot/example/assets/celestial-circus/celestial-circus.atlas
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[remap]

importer="spine.atlas"
type="SpineAtlasResource"
path="res://.import/celestial-circus.atlas-8277f39286d729eed930dc8584632c9d.spatlas"

[deps]

source_file="res://assets/celestial-circus/celestial-circus.atlas"
dest_files=[ "res://.import/celestial-circus.atlas-8277f39286d729eed930dc8584632c9d.spatlas" ]

[params]

normal_map_prefix="n"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/celestial-circus.png-362082edc9ee92c57423ee448ab8be8a.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/celestial-circus/celestial-circus.png"
dest_files=[ "res://.import/celestial-circus.png-362082edc9ee92c57423ee448ab8be8a.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[remap]

importer="spine.skel"
type="SpineSkeletonFileResource"
path="res://.import/celestial-circus.skel-57e15df02c4ab2ec1bbb6a38273235f3.spskel"

[deps]

source_file="res://assets/celestial-circus/celestial-circus.skel"
dest_files=[ "res://.import/celestial-circus.skel-57e15df02c4ab2ec1bbb6a38273235f3.spskel" ]

[params]

36 changes: 36 additions & 0 deletions spine-godot/example/examples/11-physics/physics.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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(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_Area2D_mouse_entered():
isMouseOver = true


func _on_Area2D_mouse_exited():
isMouseOver = false
30 changes: 30 additions & 0 deletions spine-godot/example/examples/11-physics/physics.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[gd_scene load_steps=4 format=2]

[ext_resource path="res://examples/11-physics/physics.gd" type="Script" id=1]
[ext_resource path="res://assets/celestial-circus/celestial-circus-data.tres" type="SpineSkeletonDataResource" id=2]

[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 600, 1155 )

[node name="Node2D" type="Node2D"]
script = ExtResource( 1 )

[node name="celestial-circus" type="SpineSprite" parent="."]
position = Vector2( 523, 437 )
scale = Vector2( 0.2, 0.2 )
skeleton_data_res = ExtResource( 2 )
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

[node name="CollisionShape2D" type="CollisionShape2D" parent="celestial-circus/Area2D"]
position = Vector2( -55.0002, -630 )
scale = Vector2( 1, 1 )
shape = SubResource( 1 )

[connection signal="mouse_entered" from="celestial-circus/Area2D" to="." method="_on_Area2D_mouse_entered"]
[connection signal="mouse_exited" from="celestial-circus/Area2D" to="." method="_on_Area2D_mouse_exited"]

0 comments on commit 0721405

Please sign in to comment.