mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
4.2 physics example for the spine-godot and the spine-ue runtime (#2497)
* Add a new example level '10-physics' and assets of celestial-circus * Fixed typos and grammatical errors in comments * Add a new example scene to example-v4 * Add a new example scene to example-v4-charp * Add a new example scene to example
This commit is contained in:
parent
11c0bf8bbe
commit
439991e3eb
@ -0,0 +1,8 @@
|
||||
[gd_resource type="SpineSkeletonDataResource" load_steps=3 format=3 uid="uid://ivqmuytdfvde"]
|
||||
|
||||
[ext_resource type="SpineAtlasResource" uid="uid://cybfgp4juu2hn" path="res://assets/celestial-circus/celestial-circus.atlas" id="1_fivh8"]
|
||||
[ext_resource type="SpineSkeletonFileResource" uid="uid://rr3h7cd7a3d5" path="res://assets/celestial-circus/celestial-circus.skel" id="2_gq3wo"]
|
||||
|
||||
[resource]
|
||||
atlas_res = ExtResource("1_fivh8")
|
||||
skeleton_file_res = ExtResource("2_gq3wo")
|
||||
@ -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
|
||||
@ -0,0 +1,15 @@
|
||||
[remap]
|
||||
|
||||
importer="spine.atlas"
|
||||
type="SpineAtlasResource"
|
||||
uid="uid://cybfgp4juu2hn"
|
||||
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"
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://clhc1actm0381"
|
||||
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.
@ -0,0 +1,14 @@
|
||||
[remap]
|
||||
|
||||
importer="spine.skel"
|
||||
type="SpineSkeletonFileResource"
|
||||
uid="uid://rr3h7cd7a3d5"
|
||||
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]
|
||||
|
||||
48
spine-godot/example-v4-csharp/examples/12-physics/physics.cs
Normal file
48
spine-godot/example-v4-csharp/examples/12-physics/physics.cs
Normal file
@ -0,0 +1,48 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class physics : Node2D
|
||||
{
|
||||
private SpineSprite celestial_circus;
|
||||
|
||||
private float last_x = -1;
|
||||
private float last_y = -1;
|
||||
private bool isMouseOver = false;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
celestial_circus = GetNode<SpineSprite>("celestial-circus");
|
||||
celestial_circus.GetAnimationState().SetAnimation("wind-idle", true, 0);
|
||||
celestial_circus.GetAnimationState().SetAnimation("eyeblink-long", true, 1);
|
||||
celestial_circus.GetAnimationState().SetAnimation("stars", true, 2);
|
||||
}
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if (Input.IsMouseButtonPressed(MouseButton.Left) && isMouseOver){
|
||||
var pos = GetViewport().GetMousePosition();
|
||||
if(last_x != -1){
|
||||
var dx = pos.X - last_x;
|
||||
var dy = pos.Y - last_y;
|
||||
celestial_circus.GlobalPosition += new Vector2(dx, dy);
|
||||
celestial_circus.GetSkeleton().PhysicsTranslate(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;
|
||||
}
|
||||
}
|
||||
|
||||
private void _on_area_2d_mouse_entered()
|
||||
{
|
||||
isMouseOver = true;
|
||||
}
|
||||
|
||||
private void _on_area_2d_mouse_exited()
|
||||
{
|
||||
isMouseOver = false;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://re2mg31p3vln"]
|
||||
|
||||
[ext_resource type="Script" path="res://examples/12-physics/physics.cs" id="1_t1cxt"]
|
||||
[ext_resource type="SpineSkeletonDataResource" uid="uid://ivqmuytdfvde" 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_t1cxt")
|
||||
|
||||
[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"]
|
||||
@ -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")
|
||||
@ -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
|
||||
@ -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"
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
@ -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.
@ -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]
|
||||
|
||||
32
spine-godot/example-v4/examples/12-physics/physics.gd
Normal file
32
spine-godot/example-v4/examples/12-physics/physics.gd
Normal file
@ -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
|
||||
31
spine-godot/example-v4/examples/12-physics/physics.tscn
Normal file
31
spine-godot/example-v4/examples/12-physics/physics.tscn
Normal file
@ -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"]
|
||||
@ -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 )
|
||||
@ -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
|
||||
@ -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"
|
||||
BIN
spine-godot/example/assets/celestial-circus/celestial-circus.png
Normal file
BIN
spine-godot/example/assets/celestial-circus/celestial-circus.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
@ -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.
@ -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
spine-godot/example/examples/11-physics/physics.gd
Normal file
36
spine-godot/example/examples/11-physics/physics.gd
Normal file
@ -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
spine-godot/example/examples/11-physics/physics.tscn
Normal file
30
spine-godot/example/examples/11-physics/physics.tscn
Normal file
@ -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"]
|
||||
@ -7,8 +7,19 @@ DefaultGraphicsPerformance=Maximum
|
||||
AppliedDefaultGraphicsPerformance=Maximum
|
||||
|
||||
[/Script/EngineSettings.GameMapsSettings]
|
||||
EditorStartupMap=/Engine/Maps/Templates/OpenWorld.OpenWorld
|
||||
LocalMapOptions=
|
||||
TransitionMap=None
|
||||
bUseSplitscreen=True
|
||||
TwoPlayerSplitscreenLayout=Horizontal
|
||||
ThreePlayerSplitscreenLayout=FavorTop
|
||||
FourPlayerSplitscreenLayout=Grid
|
||||
bOffsetPlayerGamepadIds=False
|
||||
GameInstanceClass=/Script/Engine.GameInstance
|
||||
GameDefaultMap=/Game/Test/NewWorld.NewWorld
|
||||
GlobalDefaultGameMode=/Game/Test/Blueprints/TouchClick.TouchClick_C
|
||||
ServerDefaultMap=/Engine/Maps/Entry.Entry
|
||||
GlobalDefaultGameMode=/Game/Blueprints/MouseGameModeBase.MouseGameModeBase_C
|
||||
GlobalDefaultServerGameMode=None
|
||||
|
||||
[/Script/IOSRuntimeSettings.IOSRuntimeSettings]
|
||||
bSupportsPortraitOrientation=False
|
||||
|
||||
BIN
spine-ue/Content/GettingStarted/10-physics.umap
Normal file
BIN
spine-ue/Content/GettingStarted/10-physics.umap
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -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
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user