mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
[godot] Fix up examples, segfaults, rendering
This commit is contained in:
parent
9e81422302
commit
151af3abdf
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
importer="oggvorbisstr"
|
importer="oggvorbisstr"
|
||||||
type="AudioStreamOGGVorbis"
|
type="AudioStreamOGGVorbis"
|
||||||
uid="uid://btqvnw8fgej4l"
|
uid="uid://can7k84o8svum"
|
||||||
path="res://.godot/imported/footstep.ogg-789c3f1e3c4e0ca3bebcb13f1160f623.oggvorbisstr"
|
path="res://.godot/imported/footstep.ogg-789c3f1e3c4e0ca3bebcb13f1160f623.oggvorbisstr"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
importer="spine.json"
|
importer="spine.json"
|
||||||
type="SpineSkeletonFileResource"
|
type="SpineSkeletonFileResource"
|
||||||
uid="uid://t7fk7pe11l3b"
|
uid="uid://bijrb2mt3vodc"
|
||||||
path="res://.godot/imported/mix-and-match-pro.json-57325a5014e6fd56fc4a86824bc458ea.spjson"
|
path="res://.godot/imported/mix-and-match-pro.json-57325a5014e6fd56fc4a86824bc458ea.spjson"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
importer="spine.atlas"
|
importer="spine.atlas"
|
||||||
type="SpineAtlasResource"
|
type="SpineAtlasResource"
|
||||||
uid="uid://c2hb88h3y512b"
|
uid="uid://cvu8lycjkd245"
|
||||||
path="res://.godot/imported/mix-and-match.atlas-3d349b543ecdcc01fb29033adaef0841.spatlas"
|
path="res://.godot/imported/mix-and-match.atlas-3d349b543ecdcc01fb29033adaef0841.spatlas"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://dsodn1w3yva6f"
|
uid="uid://dkpeve6qcxa70"
|
||||||
path="res://.godot/imported/mix-and-match.png-c2d8e28d9f2efc380ff8b95a22dadcc3.ctex"
|
path="res://.godot/imported/mix-and-match.png-c2d8e28d9f2efc380ff8b95a22dadcc3.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
|
|||||||
@ -0,0 +1,15 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="spine.atlas"
|
||||||
|
type="SpineAtlasResource"
|
||||||
|
uid="uid://c75mtwn6dnkwp"
|
||||||
|
path="res://.godot/imported/Raggedy Spineboy.atlas-07f7c6b30431397bcf472b18d48851e0.spatlas"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/raggedyspineboy/Raggedy Spineboy.atlas"
|
||||||
|
dest_files=["res://.godot/imported/Raggedy Spineboy.atlas-07f7c6b30431397bcf472b18d48851e0.spatlas"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
normal_map_prefix="n"
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://couyrsq850nh6"
|
||||||
|
path="res://.godot/imported/Raggedy Spineboy.png-8982b59aad5b612b7ed1a5da8b447d00.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/raggedyspineboy/Raggedy Spineboy.png"
|
||||||
|
dest_files=["res://.godot/imported/Raggedy Spineboy.png-8982b59aad5b612b7ed1a5da8b447d00.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
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
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
[gd_resource type="SpineSkeletonDataResource" load_steps=3 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://assets/raggedyspineboy/Raggedy Spineboy.atlas" type="SpineAtlasResource" id=1]
|
||||||
|
[ext_resource path="res://assets/raggedyspineboy/raggedy spineboy.json" type="SpineSkeletonFileResource" id=2]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
atlas_res = ExtResource( 1 )
|
||||||
|
skeleton_file_res = ExtResource( 2 )
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="spine.json"
|
||||||
|
type="SpineSkeletonFileResource"
|
||||||
|
uid="uid://bulrbalpjr863"
|
||||||
|
path="res://.godot/imported/raggedy spineboy.json-a7000cc987b23355ac0b09613918efcc.spjson"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/raggedyspineboy/raggedy spineboy.json"
|
||||||
|
dest_files=["res://.godot/imported/raggedy spineboy.json-a7000cc987b23355ac0b09613918efcc.spjson"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
34
spine-godot/example-v4/assets/raptor/light-sprite.png.import
Normal file
34
spine-godot/example-v4/assets/raptor/light-sprite.png.import
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://cggfs567rn1ay"
|
||||||
|
path="res://.godot/imported/light-sprite.png-346e910021b52658f1de723e4c80e05e.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/raptor/light-sprite.png"
|
||||||
|
dest_files=["res://.godot/imported/light-sprite.png-346e910021b52658f1de723e4c80e05e.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
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
|
||||||
34
spine-godot/example-v4/assets/raptor/n_raptor.png.import
Normal file
34
spine-godot/example-v4/assets/raptor/n_raptor.png.import
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://dnjt8gyvsw0l8"
|
||||||
|
path="res://.godot/imported/n_raptor.png-d9af68b4a56af2b4319bb485e366dc90.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/raptor/n_raptor.png"
|
||||||
|
dest_files=["res://.godot/imported/n_raptor.png-d9af68b4a56af2b4319bb485e366dc90.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
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
|
||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
importer="spine.skel"
|
importer="spine.skel"
|
||||||
type="SpineSkeletonFileResource"
|
type="SpineSkeletonFileResource"
|
||||||
uid="uid://do8aw2r36b6qk"
|
uid="uid://dor8huwld4f84"
|
||||||
path="res://.godot/imported/raptor-pro.skel-022e23a5f5581547a2d7faa9fb2c54e3.spskel"
|
path="res://.godot/imported/raptor-pro.skel-022e23a5f5581547a2d7faa9fb2c54e3.spskel"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
importer="spine.atlas"
|
importer="spine.atlas"
|
||||||
type="SpineAtlasResource"
|
type="SpineAtlasResource"
|
||||||
uid="uid://em5emiut17gv"
|
uid="uid://dhtyf5vltqsjg"
|
||||||
path="res://.godot/imported/raptor.atlas-66da4b831eebf404341993162ba3ddb8.spatlas"
|
path="res://.godot/imported/raptor.atlas-66da4b831eebf404341993162ba3ddb8.spatlas"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://b173v4l5brfj"
|
uid="uid://ucvdpil67hul"
|
||||||
path="res://.godot/imported/raptor.png-505be50f63fd1d0fb9175a9efbb9776c.ctex"
|
path="res://.godot/imported/raptor.png-505be50f63fd1d0fb9175a9efbb9776c.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
importer="spine.json"
|
importer="spine.json"
|
||||||
type="SpineSkeletonFileResource"
|
type="SpineSkeletonFileResource"
|
||||||
uid="uid://d0sh0yumfhw5k"
|
uid="uid://drl0og0imdkla"
|
||||||
path="res://.godot/imported/spineboy-pro.json-60444223fe3960c6d4c33b92d7495419.spjson"
|
path="res://.godot/imported/spineboy-pro.json-60444223fe3960c6d4c33b92d7495419.spjson"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
importer="spine.skel"
|
importer="spine.skel"
|
||||||
type="SpineSkeletonFileResource"
|
type="SpineSkeletonFileResource"
|
||||||
uid="uid://c4ksiwem3sg21"
|
uid="uid://cth0eypg16cgi"
|
||||||
path="res://.godot/imported/spineboy-pro.skel-52781a88227740d2a80cb8d7636ea22e.spskel"
|
path="res://.godot/imported/spineboy-pro.skel-52781a88227740d2a80cb8d7636ea22e.spskel"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
importer="spine.atlas"
|
importer="spine.atlas"
|
||||||
type="SpineAtlasResource"
|
type="SpineAtlasResource"
|
||||||
uid="uid://bcrd02k17qbt"
|
uid="uid://dt2kctrit34y0"
|
||||||
path="res://.godot/imported/spineboy.atlas-54c12b5ff1cdaaa1b4e452a7d0d868c9.spatlas"
|
path="res://.godot/imported/spineboy.atlas-54c12b5ff1cdaaa1b4e452a7d0d868c9.spatlas"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://b8she3akx8ig"
|
uid="uid://bh5imhdfuc6m0"
|
||||||
path="res://.godot/imported/spineboy.png-436dbd6da2b707b6828ede17b7871f43.ctex"
|
path="res://.godot/imported/spineboy.png-436dbd6da2b707b6828ede17b7871f43.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
|
|||||||
@ -1,12 +1,18 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://covnpp5pbw5g7"]
|
[gd_scene load_steps=3 format=3 uid="uid://d0v5rhv2ysej8"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://examples/01-helloworld/helloworld.gd" id="2_hkbn2"]
|
[ext_resource type="Script" path="res://examples/01-helloworld/spineboy-helloworld.gd" id="1"]
|
||||||
[ext_resource type="SpineSkeletonDataResource" path="res://assets/spineboy/spinebody-data-res.tres" id="3"]
|
[ext_resource type="SpineSkeletonDataResource" path="res://assets/spineboy/spineboy-data-res.tres" id="3"]
|
||||||
|
|
||||||
[node name="Node2D" type="Node2D"]
|
[node name="Node2D" type="Node2D"]
|
||||||
|
|
||||||
[node name="Spineboy" type="SpineSprite" parent="."]
|
[node name="Spineboy" type="SpineSprite" parent="."]
|
||||||
position = Vector2(496.207, 477.185)
|
position = Vector2(505, 466)
|
||||||
scale = Vector2(0.466832, 0.466832)
|
scale = Vector2(0.466832, 0.466832)
|
||||||
skeleton_data_res = ExtResource( "3" )
|
skeleton_data_res = ExtResource( "3" )
|
||||||
script = ExtResource( "2_hkbn2" )
|
bones_color = Color(0.968627, 1, 0, 0.501961)
|
||||||
|
paths_color = Color(1, 0.498039, 0, 0.466667)
|
||||||
|
paths_clipping = Color(0.8, 0, 0, 0.5)
|
||||||
|
preview_animation = "run"
|
||||||
|
preview_frame = true
|
||||||
|
preview_time = 0.24
|
||||||
|
script = ExtResource( "1" )
|
||||||
|
|||||||
@ -1,12 +0,0 @@
|
|||||||
[gd_scene load_steps=3 format=3]
|
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://examples/01-helloworld/helloworld.gd" id="1"]
|
|
||||||
[ext_resource type="SpineSkeletonDataResource" path="res://assets/spineboy/spinebody-data-res.tres" id="3"]
|
|
||||||
|
|
||||||
[node name="Node2D" type="Node2D"]
|
|
||||||
|
|
||||||
[node name="Spineboy" type="SpineSprite" parent="."]
|
|
||||||
position = Vector2(496.207, 477.185)
|
|
||||||
scale = Vector2(0.466832, 0.466832)
|
|
||||||
skeleton_data_res = ExtResource( "3" )
|
|
||||||
script = ExtResource( "1" )
|
|
||||||
@ -27,12 +27,12 @@ func _ready():
|
|||||||
var animation_state = spineboy.get_animation_state()
|
var animation_state = spineboy.get_animation_state()
|
||||||
animation_state.set_animation("jump", false, 0)
|
animation_state.set_animation("jump", false, 0)
|
||||||
animation_state.add_animation("walk", 0, true, 0)
|
animation_state.add_animation("walk", 0, true, 0)
|
||||||
animation_state.add_animation("run", 2, true, 0)
|
animation_state.add_animation("run", 2, true, 0)
|
||||||
|
|
||||||
spineboy.connect("animation_started", Callable(self, "_animation_started"))
|
spineboy.animation_started.connect(_animation_started)
|
||||||
spineboy.connect("animation_interrupted", Callable(self, "_animation_interrupted"))
|
spineboy.animation_interrupted.connect(_animation_interrupted)
|
||||||
spineboy.connect("animation_ended", Callable(self, "_animation_ended"))
|
spineboy.animation_ended.connect(_animation_ended)
|
||||||
spineboy.connect("animation_completed", Callable(self, "_animation_completed"))
|
spineboy.animation_completed.connect(_animation_completed)
|
||||||
spineboy.connect("animation_disposed", Callable(self, "_animation_disposed"))
|
spineboy.animation_disposed.connect(_animation_disposed)
|
||||||
spineboy.connect("animation_event", Callable(self, "_animation_event"))
|
spineboy.animation_event.connect(_animation_event)
|
||||||
pass
|
pass
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
[gd_scene load_steps=4 format=3 uid="uid://pybgwkgp2y7o"]
|
[gd_scene load_steps=4 format=3 uid="uid://c738i3nbdkn0h"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://examples/02-animation-state-listeners/animation-state-listeners.gd" id="1"]
|
[ext_resource type="Script" path="res://examples/02-animation-state-listeners/animation-state-listeners.gd" id="1"]
|
||||||
[ext_resource type="SpineSkeletonDataResource" path="res://assets/spineboy/spinebody-data-res.tres" id="2"]
|
[ext_resource type="SpineSkeletonDataResource" path="res://assets/spineboy/spineboy-data-res.tres" id="2"]
|
||||||
[ext_resource type="AudioStream" uid="uid://btqvnw8fgej4l" path="res://assets/footstep.ogg" id="3"]
|
[ext_resource type="AudioStream" uid="uid://can7k84o8svum" path="res://assets/footstep.ogg" id="3"]
|
||||||
|
|
||||||
[node name="Node2D" type="Node2D"]
|
[node name="Node2D" type="Node2D"]
|
||||||
script = ExtResource( "1" )
|
script = ExtResource( "1" )
|
||||||
@ -11,6 +11,9 @@ script = ExtResource( "1" )
|
|||||||
position = Vector2(473, 487)
|
position = Vector2(473, 487)
|
||||||
scale = Vector2(0.575051, 0.575051)
|
scale = Vector2(0.575051, 0.575051)
|
||||||
skeleton_data_res = ExtResource( "2" )
|
skeleton_data_res = ExtResource( "2" )
|
||||||
|
preview_animation = "-- Empty --"
|
||||||
|
preview_frame = false
|
||||||
|
preview_time = 0.0
|
||||||
|
|
||||||
[node name="FootstepAudio" type="AudioStreamPlayer" parent="."]
|
[node name="FootstepAudio" type="AudioStreamPlayer" parent="."]
|
||||||
stream = ExtResource( "3" )
|
stream = ExtResource( "3" )
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://2y54bey2t35l"]
|
[gd_scene load_steps=3 format=3 uid="uid://dodvuj07fsynd"]
|
||||||
|
|
||||||
[ext_resource type="SpineSkeletonDataResource" path="res://assets/mix-and-match/mix-and-match-data.tres" id="1"]
|
[ext_resource type="SpineSkeletonDataResource" path="res://assets/mix-and-match/mix-and-match-data.tres" id="1"]
|
||||||
[ext_resource type="Script" path="res://examples/03-mix-and-match/mix-and-match.gd" id="2"]
|
[ext_resource type="Script" path="res://examples/03-mix-and-match/mix-and-match.gd" id="2"]
|
||||||
@ -9,4 +9,7 @@
|
|||||||
position = Vector2(532.982, 480.287)
|
position = Vector2(532.982, 480.287)
|
||||||
scale = Vector2(0.441932, 0.441932)
|
scale = Vector2(0.441932, 0.441932)
|
||||||
skeleton_data_res = ExtResource( "1" )
|
skeleton_data_res = ExtResource( "1" )
|
||||||
|
preview_animation = "-- Empty --"
|
||||||
|
preview_frame = false
|
||||||
|
preview_time = 0.0
|
||||||
script = ExtResource( "2" )
|
script = ExtResource( "2" )
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://ca3tp7fuv1i77"]
|
[gd_scene load_steps=3 format=3 uid="uid://bgdpghp11j3kg"]
|
||||||
|
|
||||||
[ext_resource type="SpineSkeletonDataResource" path="res://assets/spineboy/spinebody-data-res.tres" id="1"]
|
[ext_resource type="SpineSkeletonDataResource" path="res://assets/spineboy/spineboy-data-res.tres" id="1"]
|
||||||
[ext_resource type="Script" path="res://examples/04-simple-input/simple-input.gd" id="2_lsf60"]
|
[ext_resource type="Script" path="res://examples/04-simple-input/spineboy-simple-input.gd" id="2"]
|
||||||
|
|
||||||
[node name="Node2D" type="Node2D"]
|
[node name="Node2D" type="Node2D"]
|
||||||
|
|
||||||
@ -9,4 +9,7 @@
|
|||||||
position = Vector2(501.503, 472.035)
|
position = Vector2(501.503, 472.035)
|
||||||
scale = Vector2(0.518624, 0.518624)
|
scale = Vector2(0.518624, 0.518624)
|
||||||
skeleton_data_res = ExtResource( "1" )
|
skeleton_data_res = ExtResource( "1" )
|
||||||
script = ExtResource( "2_lsf60" )
|
preview_animation = "-- Empty --"
|
||||||
|
preview_frame = false
|
||||||
|
preview_time = 0.0
|
||||||
|
script = ExtResource( "2" )
|
||||||
|
|||||||
@ -1,12 +0,0 @@
|
|||||||
[gd_scene load_steps=3 format=3]
|
|
||||||
|
|
||||||
[ext_resource type="SpineSkeletonDataResource" path="res://assets/spineboy/spinebody-data-res.tres" id="1"]
|
|
||||||
[ext_resource type="Script" path="res://examples/04-simple-input/simple-input.gd" id="2"]
|
|
||||||
|
|
||||||
[node name="Node2D" type="Node2D"]
|
|
||||||
|
|
||||||
[node name="Spineboy" type="SpineSprite" parent="."]
|
|
||||||
position = Vector2( 501.503, 472.035 )
|
|
||||||
scale = Vector2( 0.518624, 0.518624 )
|
|
||||||
skeleton_data_res = ExtResource( 1 )
|
|
||||||
script = ExtResource( 2 )
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
extends SpineSprite
|
extends SpineSprite
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
get_animation_state().set_animation("idle", true, 0)
|
get_animation_state().set_animation("idle", true, 0)
|
||||||
|
|
||||||
func _process(_delta):
|
func _process(_delta):
|
||||||
@ -1,11 +1,11 @@
|
|||||||
extends Node2D
|
extends Node2D
|
||||||
|
|
||||||
@onready var spineboy: SpineSprite = $Spineboy
|
@onready var spineboy: SpineSprite = $Spineboy
|
||||||
|
@onready var crosshair_bone: SpineBoneNode = $Spineboy/CrosshairBone
|
||||||
func _before_world_transforms_change(_sprite):
|
|
||||||
spineboy.set_global_bone_transform("crosshair", Transform2D(0, get_viewport().get_mouse_position()))
|
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
spineboy.get_animation_state().set_animation("walk", true, 0)
|
spineboy.get_animation_state().set_animation("walk", true, 0)
|
||||||
spineboy.get_animation_state().set_animation("aim", true, 1)
|
spineboy.get_animation_state().set_animation("aim", true, 1)
|
||||||
spineboy.connect("before_world_transforms_change", Callable(self, "_before_world_transforms_change"))
|
|
||||||
|
func _process(_delta):
|
||||||
|
crosshair_bone.global_position = get_viewport().get_mouse_position()
|
||||||
|
|||||||
@ -1,12 +1,22 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://bfkgc16yqcdyi"]
|
[gd_scene load_steps=3 format=3 uid="uid://borp2l17n5xw1"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://examples/05-mouse-following/mouse-following.gd" id="1"]
|
[ext_resource type="Script" path="res://examples/05-mouse-following/mouse-following.gd" id="1"]
|
||||||
[ext_resource type="SpineSkeletonDataResource" path="res://assets/spineboy/spinebody-data-res.tres" id="2"]
|
[ext_resource type="SpineSkeletonDataResource" path="res://assets/spineboy/spineboy-data-res.tres" id="2"]
|
||||||
|
|
||||||
[node name="Node2D" type="Node2D"]
|
[node name="Node2D" type="Node2D"]
|
||||||
script = ExtResource( "1" )
|
script = ExtResource( "1" )
|
||||||
|
|
||||||
[node name="Spineboy" type="SpineSprite" parent="."]
|
[node name="Spineboy" type="SpineSprite" parent="."]
|
||||||
position = Vector2(481, 457)
|
position = Vector2(481, 457)
|
||||||
scale = Vector2(0.457952, 0.457952)
|
scale = Vector2(0.5, 0.5)
|
||||||
skeleton_data_res = ExtResource( "2" )
|
skeleton_data_res = ExtResource( "2" )
|
||||||
|
preview_animation = "-- Empty --"
|
||||||
|
preview_frame = false
|
||||||
|
preview_time = 0.0
|
||||||
|
|
||||||
|
[node name="CrosshairBone" type="SpineBoneNode" parent="Spineboy"]
|
||||||
|
show_behind_parent = true
|
||||||
|
position = Vector2(302.333, -569.714)
|
||||||
|
rotation = -0.000872665
|
||||||
|
bone_name = "crosshair"
|
||||||
|
bone_mode = 1
|
||||||
|
|||||||
@ -1,11 +1,5 @@
|
|||||||
extends Node2D
|
extends Node2D
|
||||||
|
|
||||||
@onready var spineboy: SpineSprite = $Spineboy
|
|
||||||
@onready var sprite: Sprite2D = $Spineboy/Sprite
|
|
||||||
|
|
||||||
func _world_transforms_changed(_sprite):
|
|
||||||
sprite.global_transform = spineboy.get_global_bone_transform("gun-tip")
|
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
spineboy.get_animation_state().set_animation("walk", true, 0)
|
var spineboy: SpineSprite = $Spineboy
|
||||||
spineboy.connect("world_transforms_changed", Callable(self, "_world_transforms_changed"))
|
spineboy.get_animation_state().set_animation("walk", true, 0)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[gd_scene load_steps=4 format=3 uid="uid://dm0y2i1jdd28x"]
|
[gd_scene load_steps=4 format=3 uid="uid://bir7yvf0qwdge"]
|
||||||
|
|
||||||
[ext_resource type="SpineSkeletonDataResource" path="res://assets/spineboy/spinebody-data-res.tres" id="1"]
|
[ext_resource type="SpineSkeletonDataResource" path="res://assets/spineboy/spineboy-data-res.tres" id="1"]
|
||||||
[ext_resource type="Script" path="res://examples/06-bone-following/bone-following.gd" id="2"]
|
[ext_resource type="Script" path="res://examples/06-bone-following/bone-following.gd" id="2"]
|
||||||
[ext_resource type="Texture2D" uid="uid://8ud5n2ywp5ba" path="res://icon.png" id="3"]
|
[ext_resource type="Texture2D" uid="uid://8ud5n2ywp5ba" path="res://icon.png" id="3"]
|
||||||
|
|
||||||
@ -11,7 +11,15 @@ script = ExtResource( "2" )
|
|||||||
position = Vector2(478, 483)
|
position = Vector2(478, 483)
|
||||||
scale = Vector2(0.58461, 0.58461)
|
scale = Vector2(0.58461, 0.58461)
|
||||||
skeleton_data_res = ExtResource( "1" )
|
skeleton_data_res = ExtResource( "1" )
|
||||||
|
preview_animation = ""
|
||||||
|
preview_frame = false
|
||||||
|
preview_time = 0.0
|
||||||
|
|
||||||
[node name="Sprite" type="Sprite2D" parent="Spineboy"]
|
[node name="GunTipBone" type="SpineBoneNode" parent="Spineboy"]
|
||||||
position = Vector2(20, 20)
|
show_behind_parent = true
|
||||||
|
position = Vector2(214.298, -162.047)
|
||||||
|
rotation = 0.713316
|
||||||
|
bone_name = "gun-tip"
|
||||||
|
|
||||||
|
[node name="Sprite" type="Sprite2D" parent="Spineboy/GunTipBone"]
|
||||||
texture = ExtResource( "3" )
|
texture = ExtResource( "3" )
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
extends Node2D
|
extends Node2D
|
||||||
|
|
||||||
@onready var spineboy: SpineSprite = $Spineboy
|
@onready var spineboy: SpineSprite = $Spineboy
|
||||||
@onready var raptor: SpineSprite = $Spineboy/SlotNodeGun/Raptor
|
@onready var raptor: SpineSprite = $Spineboy/GunSlot/Raptor
|
||||||
@onready var tiny_spineboy: SpineSprite = $Spineboy/SlotNodeFrontFist/TinySpineboy
|
@onready var tiny_spineboy: SpineSprite = $Spineboy/FrontFistSlot/TinySpineboy
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
var entry = spineboy.get_animation_state().set_animation("run", true, 0)
|
var entry = spineboy.get_animation_state().set_animation("run", true, 0)
|
||||||
entry.set_time_scale(0.1)
|
entry.set_time_scale(0.1)
|
||||||
raptor.get_animation_state().set_animation("walk", true, 0)
|
raptor.get_animation_state().set_animation("walk", true, 0)
|
||||||
|
|||||||
@ -1,35 +1,56 @@
|
|||||||
[gd_scene load_steps=4 format=3 uid="uid://ca6sxv2ecmfue"]
|
[gd_scene load_steps=5 format=3 uid="uid://bhht8dees2pyq"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://examples/07-slot-node/slot-node.gd" id="1"]
|
[ext_resource type="Script" path="res://examples/07-slot-node/slot-node.gd" id="1"]
|
||||||
[ext_resource type="SpineSkeletonDataResource" path="res://assets/spineboy/spinebody-data-res.tres" id="2"]
|
[ext_resource type="SpineSkeletonDataResource" path="res://assets/spineboy/spineboy-data-res.tres" id="2"]
|
||||||
[ext_resource type="SpineSkeletonDataResource" path="res://assets/raptor/raprot-data.tres" id="3"]
|
[ext_resource type="SpineSkeletonDataResource" path="res://assets/raptor/raptor-data.tres" id="3"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://8ud5n2ywp5ba" path="res://icon.png" id="4"]
|
||||||
|
|
||||||
[node name="Node2D" type="Node2D"]
|
[node name="Node2D" type="Node2D"]
|
||||||
script = ExtResource( "1" )
|
script = ExtResource( "1" )
|
||||||
|
|
||||||
[node name="Spineboy" type="SpineSprite" parent="."]
|
[node name="Spineboy" type="SpineSprite" parent="."]
|
||||||
position = Vector2(506, 480)
|
position = Vector2(474, 506)
|
||||||
scale = Vector2(0.560712, 0.560712)
|
scale = Vector2(0.560712, 0.560712)
|
||||||
skeleton_data_res = ExtResource( "2" )
|
skeleton_data_res = ExtResource( "2" )
|
||||||
|
preview_animation = "-- Empty --"
|
||||||
|
preview_frame = false
|
||||||
|
preview_time = 0.0
|
||||||
|
|
||||||
[node name="SlotNodeGun" type="SpineSlotNode" parent="Spineboy"]
|
[node name="GunSlot" type="SpineSlotNode" parent="Spineboy"]
|
||||||
position = Vector2(40.8752, -276.036)
|
show_behind_parent = true
|
||||||
|
position = Vector2(40.8753, -276.036)
|
||||||
rotation = 0.837234
|
rotation = 0.837234
|
||||||
scale = Vector2(1, 1)
|
|
||||||
slot_name = "gun"
|
slot_name = "gun"
|
||||||
|
|
||||||
[node name="Raptor" type="SpineSprite" parent="Spineboy/SlotNodeGun"]
|
[node name="Raptor" type="SpineSprite" parent="Spineboy/GunSlot"]
|
||||||
position = Vector2(84.6909, -67.9174)
|
position = Vector2(84.6909, -67.9174)
|
||||||
scale = Vector2(0.193472, 0.193472)
|
scale = Vector2(0.193472, 0.193472)
|
||||||
skeleton_data_res = ExtResource( "3" )
|
skeleton_data_res = ExtResource( "3" )
|
||||||
|
preview_animation = "-- Empty --"
|
||||||
|
preview_frame = false
|
||||||
|
preview_time = 0.0
|
||||||
|
|
||||||
[node name="SlotNodeFrontFist" type="SpineSlotNode" parent="Spineboy"]
|
[node name="EyeSlot" type="SpineSlotNode" parent="Spineboy"]
|
||||||
|
show_behind_parent = true
|
||||||
|
position = Vector2(-23.4598, -402.301)
|
||||||
|
rotation = -1.71793
|
||||||
|
slot_name = "eye"
|
||||||
|
|
||||||
|
[node name="Sprite" type="Sprite2D" parent="Spineboy/EyeSlot"]
|
||||||
|
position = Vector2(84.4734, 43.4469)
|
||||||
|
rotation = 1.66344
|
||||||
|
texture = ExtResource( "4" )
|
||||||
|
|
||||||
|
[node name="FrontFistSlot" type="SpineSlotNode" parent="Spineboy"]
|
||||||
|
show_behind_parent = true
|
||||||
position = Vector2(-29.0298, -241.577)
|
position = Vector2(-29.0298, -241.577)
|
||||||
rotation = 0.995187
|
rotation = 0.995187
|
||||||
scale = Vector2(1, 1)
|
|
||||||
slot_name = "front-fist"
|
slot_name = "front-fist"
|
||||||
|
|
||||||
[node name="TinySpineboy" type="SpineSprite" parent="Spineboy/SlotNodeFrontFist"]
|
[node name="TinySpineboy" type="SpineSprite" parent="Spineboy/FrontFistSlot"]
|
||||||
position = Vector2(-2.64624, -10.8111)
|
position = Vector2(-2.64624, -10.8111)
|
||||||
scale = Vector2(0.193389, 0.193389)
|
scale = Vector2(0.193389, 0.193389)
|
||||||
skeleton_data_res = ExtResource( "2" )
|
skeleton_data_res = ExtResource( "2" )
|
||||||
|
preview_animation = "-- Empty --"
|
||||||
|
preview_frame = false
|
||||||
|
preview_time = 0.0
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,43 @@
|
|||||||
|
[gd_scene load_steps=6 format=3 uid="uid://b4p2vn7bwm52a"]
|
||||||
|
|
||||||
|
[ext_resource type="SpineSkeletonDataResource" path="res://assets/spineboy/spineboy-data-res.tres" id="1"]
|
||||||
|
|
||||||
|
[sub_resource type="Shader" id="1"]
|
||||||
|
code = "shader_type canvas_item;
|
||||||
|
|
||||||
|
void fragment() {
|
||||||
|
COLOR = texture(TEXTURE, UV);
|
||||||
|
COLOR.r = 0.0;
|
||||||
|
}"
|
||||||
|
|
||||||
|
[sub_resource type="ShaderMaterial" id="2"]
|
||||||
|
shader = SubResource( "1" )
|
||||||
|
|
||||||
|
[sub_resource type="Shader" id="3"]
|
||||||
|
code = "shader_type canvas_item;
|
||||||
|
|
||||||
|
void fragment() {
|
||||||
|
COLOR = texture(TEXTURE, UV);
|
||||||
|
COLOR.b = 0.0;
|
||||||
|
}"
|
||||||
|
|
||||||
|
[sub_resource type="ShaderMaterial" id="4"]
|
||||||
|
shader = SubResource( "3" )
|
||||||
|
|
||||||
|
[node name="Node2D" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="SpineSprite" type="SpineSprite" parent="."]
|
||||||
|
position = Vector2(501, 507)
|
||||||
|
scale = Vector2(0.546374, 0.546373)
|
||||||
|
skeleton_data_res = ExtResource( "1" )
|
||||||
|
normal_material = SubResource( "2" )
|
||||||
|
preview_animation = "-- Empty --"
|
||||||
|
preview_frame = false
|
||||||
|
preview_time = 0.0
|
||||||
|
|
||||||
|
[node name="GunSlot" type="SpineSlotNode" parent="SpineSprite"]
|
||||||
|
show_behind_parent = true
|
||||||
|
position = Vector2(40.8753, -276.036)
|
||||||
|
rotation = 0.837234
|
||||||
|
slot_name = "gun"
|
||||||
|
normal_material = SubResource( "4" )
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
extends Node2D
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
$SpineSprite.get_animation_state().set_animation("walk");
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
[gd_scene load_steps=4 format=3 uid="uid://rt2llskmx7xm"]
|
||||||
|
|
||||||
|
[ext_resource type="SpineSkeletonDataResource" path="res://assets/raptor/raptor-data.tres" id="1"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cggfs567rn1ay" path="res://assets/raptor/light-sprite.png" id="2"]
|
||||||
|
[ext_resource type="Script" path="res://examples/10-2d-lighting/2d-lighting.gd" id="3"]
|
||||||
|
|
||||||
|
[node name="Node2D" type="Node2D"]
|
||||||
|
script = ExtResource( "3" )
|
||||||
|
|
||||||
|
[node name="SpineSprite" type="SpineSprite" parent="."]
|
||||||
|
position = Vector2(576, 506)
|
||||||
|
scale = Vector2(0.458967, 0.458967)
|
||||||
|
skeleton_data_res = ExtResource( "1" )
|
||||||
|
preview_animation = "-- Empty --"
|
||||||
|
preview_frame = false
|
||||||
|
preview_time = 0.0
|
||||||
|
|
||||||
|
[node name="Light2D" type="PointLight2D" parent="."]
|
||||||
|
position = Vector2(822, 270)
|
||||||
|
scale = Vector2(1.51563, 1.51563)
|
||||||
|
color = Color(1, 0.0117647, 0.0117647, 1)
|
||||||
|
texture = ExtResource( "2" )
|
||||||
|
|
||||||
|
[node name="CanvasModulate" type="CanvasModulate" parent="."]
|
||||||
|
color = Color(0.145098, 0.0980392, 0.0980392, 1)
|
||||||
19
spine-godot/example-v4/examples/11-bone-node/bone-node.gd
Normal file
19
spine-godot/example-v4/examples/11-bone-node/bone-node.gd
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
extends Node2D
|
||||||
|
|
||||||
|
@onready var spineboy = $SpineSprite
|
||||||
|
@onready var center_bone = $SpineSprite/HoverboardCenterBone
|
||||||
|
@onready var center_ray = $SpineSprite/HoverboardCenterBone/RayCast2D
|
||||||
|
@onready var target_bone = $SpineSprite/HoverboardTargetBone
|
||||||
|
@onready var target_ray = $SpineSprite/HoverboardTargetBone/RayCast2D
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
spineboy.get_animation_state().set_animation("hoverboard", true, 0)
|
||||||
|
|
||||||
|
func _physics_process(delta):
|
||||||
|
if target_ray.is_colliding():
|
||||||
|
target_bone.global_position.y = target_ray.get_collision_point().y - 50
|
||||||
|
if center_ray.is_colliding():
|
||||||
|
center_bone.global_position.y = center_ray.get_collision_point().y - 50
|
||||||
|
|
||||||
|
spineboy.global_position.x += delta * 150;
|
||||||
|
spineboy.global_position.y = center_bone.global_position.y
|
||||||
47
spine-godot/example-v4/examples/11-bone-node/bone-node.tscn
Normal file
47
spine-godot/example-v4/examples/11-bone-node/bone-node.tscn
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
[gd_scene load_steps=3 format=3 uid="uid://chrw4i0nksphn"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://examples/11-bone-node/bone-node.gd" id="1"]
|
||||||
|
[ext_resource type="SpineSkeletonDataResource" path="res://assets/spineboy/spineboy-data-res.tres" id="2"]
|
||||||
|
|
||||||
|
[node name="Node2D" type="Node2D"]
|
||||||
|
script = ExtResource( "1" )
|
||||||
|
|
||||||
|
[node name="SpineSprite" type="SpineSprite" parent="."]
|
||||||
|
position = Vector2(8, 553)
|
||||||
|
scale = Vector2(0.278096, 0.278096)
|
||||||
|
skeleton_data_res = ExtResource( "2" )
|
||||||
|
update_mode = 1
|
||||||
|
preview_animation = "hoverboard"
|
||||||
|
preview_frame = true
|
||||||
|
preview_time = 0.0
|
||||||
|
|
||||||
|
[node name="HoverboardCenterBone" type="SpineBoneNode" parent="SpineSprite"]
|
||||||
|
show_behind_parent = true
|
||||||
|
bone_name = "hoverboard-controller"
|
||||||
|
bone_mode = 1
|
||||||
|
|
||||||
|
[node name="RayCast2D" type="RayCast2D" parent="SpineSprite/HoverboardCenterBone"]
|
||||||
|
|
||||||
|
[node name="HoverboardTargetBone" type="SpineBoneNode" parent="SpineSprite"]
|
||||||
|
show_behind_parent = true
|
||||||
|
position = Vector2(262.499, 0)
|
||||||
|
rotation = -0.000872665
|
||||||
|
bone_name = "board-ik"
|
||||||
|
bone_mode = 1
|
||||||
|
|
||||||
|
[node name="RayCast2D" type="RayCast2D" parent="SpineSprite/HoverboardTargetBone"]
|
||||||
|
|
||||||
|
[node name="HipBone" type="SpineBoneNode" parent="SpineSprite"]
|
||||||
|
show_behind_parent = true
|
||||||
|
position = Vector2(0, -169.006)
|
||||||
|
rotation = -0.000872665
|
||||||
|
bone_name = "hip"
|
||||||
|
bone_mode = 1
|
||||||
|
|
||||||
|
[node name="Polygon2D" type="Polygon2D" parent="."]
|
||||||
|
polygon = PackedVector2Array(0, 596, 309, 471, 516, 515, 762, 447, 984, 504, 1023, 505, 1024, 596)
|
||||||
|
|
||||||
|
[node name="StaticBody2D" type="StaticBody2D" parent="Polygon2D"]
|
||||||
|
|
||||||
|
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Polygon2D/StaticBody2D"]
|
||||||
|
polygon = PackedVector2Array(3, 592, 304, 469, 516, 514, 762, 443, 984, 499, 1252, 498, 1280, 596)
|
||||||
File diff suppressed because it is too large
Load Diff
53
spine-godot/example-v4/tests/ragdoll.tscn
Normal file
53
spine-godot/example-v4/tests/ragdoll.tscn
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
[gd_scene format=2]
|
||||||
|
|
||||||
|
[node name="Node2D" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="A" type="RigidBody2D" parent="."]
|
||||||
|
position = Vector2( 483, 158 )
|
||||||
|
|
||||||
|
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="A"]
|
||||||
|
position = Vector2( 6, 17 )
|
||||||
|
polygon = PoolVector2Array( -38, 6, 28, 6, 28, -45, -40, -45 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_lock_": true
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="B" type="RigidBody2D" parent="."]
|
||||||
|
position = Vector2( 484, 228 )
|
||||||
|
|
||||||
|
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="B"]
|
||||||
|
position = Vector2( 6, 17 )
|
||||||
|
polygon = PoolVector2Array( -38, 6, 28, 6, 28, -45, -40, -45 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_lock_": true
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="C" type="RigidBody2D" parent="."]
|
||||||
|
position = Vector2( 485, 296 )
|
||||||
|
|
||||||
|
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="C"]
|
||||||
|
position = Vector2( 6, 17 )
|
||||||
|
polygon = PoolVector2Array( -38, 6, 28, 6, 28, -45, -40, -45 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_lock_": true
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="PinJoint2D" type="PinJoint2D" parent="."]
|
||||||
|
position = Vector2( 484, 189 )
|
||||||
|
node_a = NodePath("../A")
|
||||||
|
node_b = NodePath("../B")
|
||||||
|
bias = 0.9
|
||||||
|
disable_collision = false
|
||||||
|
|
||||||
|
[node name="PinJoint2D2" type="PinJoint2D" parent="."]
|
||||||
|
position = Vector2( 486, 257 )
|
||||||
|
node_a = NodePath("../B")
|
||||||
|
node_b = NodePath("../C")
|
||||||
|
bias = 0.9
|
||||||
|
disable_collision = false
|
||||||
|
|
||||||
|
[node name="Ground" type="StaticBody2D" parent="."]
|
||||||
|
position = Vector2( 489, 478 )
|
||||||
|
|
||||||
|
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Ground"]
|
||||||
|
polygon = PoolVector2Array( -116, -4, 128, -100, 204, 34, -156, 48 )
|
||||||
26
spine-godot/example-v4/tests/transforms.tscn
Normal file
26
spine-godot/example-v4/tests/transforms.tscn
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
[gd_scene load_steps=3 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://assets/spineboy/spineboy-data-res.tres" type="SpineSkeletonDataResource" id=1]
|
||||||
|
[ext_resource path="res://icon.png" type="Texture" id=2]
|
||||||
|
|
||||||
|
[node name="Node2D" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="SpineSprite" type="SpineSprite" parent="."]
|
||||||
|
position = Vector2( 459.397, 501.236 )
|
||||||
|
scale = Vector2( 0.742335, 0.742335 )
|
||||||
|
skeleton_data_res = ExtResource( 1 )
|
||||||
|
preview_animation = "aim"
|
||||||
|
preview_frame = true
|
||||||
|
preview_time = 0.0
|
||||||
|
|
||||||
|
[node name="SpineBoneNode" type="SpineBoneNode" parent="SpineSprite"]
|
||||||
|
position = Vector2( 40.8752, -276.036 )
|
||||||
|
rotation = 0.837234
|
||||||
|
bone_name = "gun"
|
||||||
|
bone_mode = 1
|
||||||
|
enabled = false
|
||||||
|
color = Color( 0, 1, 0.0627451, 0.466667 )
|
||||||
|
|
||||||
|
[node name="Sprite" type="Sprite" parent="SpineSprite/SpineBoneNode"]
|
||||||
|
visible = false
|
||||||
|
texture = ExtResource( 2 )
|
||||||
@ -1,12 +1,12 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://32p13eo7undk"]
|
[gd_scene load_steps=3 format=2]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://tests/unit-tests.gd" id="1"]
|
[ext_resource path="res://tests/unit-tests.gd" type="Script" id=1]
|
||||||
[ext_resource type="SpineSkeletonDataResource" path="res://assets/spineboy/spinebody-data-res.tres" id="2"]
|
[ext_resource path="res://assets/spineboy/spineboy-data-res.tres" type="SpineSkeletonDataResource" id=2]
|
||||||
|
|
||||||
[node name="Node2D" type="Node2D"]
|
[node name="Node2D" type="Node2D"]
|
||||||
position = Vector2(496.659, 431.634)
|
position = Vector2( 496.659, 431.634 )
|
||||||
scale = Vector2(0.7, 0.7)
|
scale = Vector2( 0.7, 0.7 )
|
||||||
|
|
||||||
[node name="SpineSprite" type="SpineSprite" parent="."]
|
[node name="SpineSprite" type="SpineSprite" parent="."]
|
||||||
skeleton_data_res = ExtResource( "2" )
|
skeleton_data_res = ExtResource( 2 )
|
||||||
script = ExtResource( "1" )
|
script = ExtResource( 1 )
|
||||||
|
|||||||
@ -396,6 +396,7 @@ bool SpineSprite::_get(const StringName &property, Variant &value) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void update_preview_animation(SpineSprite *sprite, const String &animation, bool frame, float time) {
|
static void update_preview_animation(SpineSprite *sprite, const String &animation, bool frame, float time) {
|
||||||
|
if (!sprite->get_skeleton().is_valid()) return;
|
||||||
sprite->get_skeleton()->set_to_setup_pose();
|
sprite->get_skeleton()->set_to_setup_pose();
|
||||||
if (EMPTY(animation) || animation == "-- Empty --") {
|
if (EMPTY(animation) || animation == "-- Empty --") {
|
||||||
sprite->get_animation_state()->set_empty_animation(0, 0);
|
sprite->get_animation_state()->set_empty_animation(0, 0);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user