diff --git a/doc/demo10_animation/animation.md b/doc/demo10_animation/animation.md index 05ae115..b9d55ba 100644 --- a/doc/demo10_animation/animation.md +++ b/doc/demo10_animation/animation.md @@ -1,2 +1,15 @@ +![Image text](image/animation1.png) +![Image text](image/animation2.png) +![Image text](image/animation3.png) +![Image text](image/animation4.png) +![Image text](image/animation5.png) +![Image text](image/animation6.png) +![Image text](image/animation7.png) +![Image text](image/animation8.png) +![Image text](image/animation9.png) +![Image text](image/animation10.png) +![Image text](image/animation11.png) +![Image text](image/animation12.png) + - AnimationPlayer是时间和属性的变化,是一种动画的表现 - AnimatedSprite是序列帧的简便的用法 diff --git a/doc/demo10_animation/image/animation1.png b/doc/demo10_animation/image/animation1.png new file mode 100644 index 0000000..3498cdb Binary files /dev/null and b/doc/demo10_animation/image/animation1.png differ diff --git a/doc/demo10_animation/image/animation1.png.import b/doc/demo10_animation/image/animation1.png.import new file mode 100644 index 0000000..a245b67 --- /dev/null +++ b/doc/demo10_animation/image/animation1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/animation1.png-2e16c162dbddc0ebeea917f892fabba4.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://doc/demo10_animation/image/animation1.png" +dest_files=[ "res://.import/animation1.png-2e16c162dbddc0ebeea917f892fabba4.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/doc/demo10_animation/image/animation10.png b/doc/demo10_animation/image/animation10.png new file mode 100644 index 0000000..cdfe7bc Binary files /dev/null and b/doc/demo10_animation/image/animation10.png differ diff --git a/doc/demo10_animation/image/animation10.png.import b/doc/demo10_animation/image/animation10.png.import new file mode 100644 index 0000000..54be114 --- /dev/null +++ b/doc/demo10_animation/image/animation10.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/animation10.png-0ee535f733c49f16435a95c4ba7696d6.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://doc/demo10_animation/image/animation10.png" +dest_files=[ "res://.import/animation10.png-0ee535f733c49f16435a95c4ba7696d6.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/doc/demo10_animation/image/animation11.png b/doc/demo10_animation/image/animation11.png new file mode 100644 index 0000000..4fb8387 Binary files /dev/null and b/doc/demo10_animation/image/animation11.png differ diff --git a/doc/demo10_animation/image/animation11.png.import b/doc/demo10_animation/image/animation11.png.import new file mode 100644 index 0000000..5a9479e --- /dev/null +++ b/doc/demo10_animation/image/animation11.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/animation11.png-84727766c32c30b25d868cdb214b5850.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://doc/demo10_animation/image/animation11.png" +dest_files=[ "res://.import/animation11.png-84727766c32c30b25d868cdb214b5850.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/doc/demo10_animation/image/animation12.png b/doc/demo10_animation/image/animation12.png new file mode 100644 index 0000000..9108df9 Binary files /dev/null and b/doc/demo10_animation/image/animation12.png differ diff --git a/doc/demo10_animation/image/animation12.png.import b/doc/demo10_animation/image/animation12.png.import new file mode 100644 index 0000000..ef585b3 --- /dev/null +++ b/doc/demo10_animation/image/animation12.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/animation12.png-b7ed43304f2d1f516db5659d7270393f.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://doc/demo10_animation/image/animation12.png" +dest_files=[ "res://.import/animation12.png-b7ed43304f2d1f516db5659d7270393f.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/doc/demo10_animation/image/animation2.png b/doc/demo10_animation/image/animation2.png new file mode 100644 index 0000000..c712a52 Binary files /dev/null and b/doc/demo10_animation/image/animation2.png differ diff --git a/doc/demo10_animation/image/animation2.png.import b/doc/demo10_animation/image/animation2.png.import new file mode 100644 index 0000000..e358776 --- /dev/null +++ b/doc/demo10_animation/image/animation2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/animation2.png-bc27a339fd439363838ca5844b41e97e.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://doc/demo10_animation/image/animation2.png" +dest_files=[ "res://.import/animation2.png-bc27a339fd439363838ca5844b41e97e.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/doc/demo10_animation/image/animation3.png b/doc/demo10_animation/image/animation3.png new file mode 100644 index 0000000..f7828ca Binary files /dev/null and b/doc/demo10_animation/image/animation3.png differ diff --git a/doc/demo10_animation/image/animation3.png.import b/doc/demo10_animation/image/animation3.png.import new file mode 100644 index 0000000..b8e2390 --- /dev/null +++ b/doc/demo10_animation/image/animation3.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/animation3.png-3192fccf241921ac6b5248ba6de88a6f.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://doc/demo10_animation/image/animation3.png" +dest_files=[ "res://.import/animation3.png-3192fccf241921ac6b5248ba6de88a6f.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/doc/demo10_animation/image/animation4.png b/doc/demo10_animation/image/animation4.png new file mode 100644 index 0000000..ff2d40d Binary files /dev/null and b/doc/demo10_animation/image/animation4.png differ diff --git a/doc/demo10_animation/image/animation4.png.import b/doc/demo10_animation/image/animation4.png.import new file mode 100644 index 0000000..0943ba5 --- /dev/null +++ b/doc/demo10_animation/image/animation4.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/animation4.png-895a32a551825612b04d629a186dc146.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://doc/demo10_animation/image/animation4.png" +dest_files=[ "res://.import/animation4.png-895a32a551825612b04d629a186dc146.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/doc/demo10_animation/image/animation5.png b/doc/demo10_animation/image/animation5.png new file mode 100644 index 0000000..df80a88 Binary files /dev/null and b/doc/demo10_animation/image/animation5.png differ diff --git a/doc/demo10_animation/image/animation5.png.import b/doc/demo10_animation/image/animation5.png.import new file mode 100644 index 0000000..55d1f07 --- /dev/null +++ b/doc/demo10_animation/image/animation5.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/animation5.png-3add2638e06576c63401c3a7939ed408.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://doc/demo10_animation/image/animation5.png" +dest_files=[ "res://.import/animation5.png-3add2638e06576c63401c3a7939ed408.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/doc/demo10_animation/image/animation6.png b/doc/demo10_animation/image/animation6.png new file mode 100644 index 0000000..90628fc Binary files /dev/null and b/doc/demo10_animation/image/animation6.png differ diff --git a/doc/demo10_animation/image/animation6.png.import b/doc/demo10_animation/image/animation6.png.import new file mode 100644 index 0000000..00629ec --- /dev/null +++ b/doc/demo10_animation/image/animation6.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/animation6.png-699ccbcad3d4abb79eaf96b469875995.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://doc/demo10_animation/image/animation6.png" +dest_files=[ "res://.import/animation6.png-699ccbcad3d4abb79eaf96b469875995.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/doc/demo10_animation/image/animation7.png b/doc/demo10_animation/image/animation7.png new file mode 100644 index 0000000..f5ab3c7 Binary files /dev/null and b/doc/demo10_animation/image/animation7.png differ diff --git a/doc/demo10_animation/image/animation7.png.import b/doc/demo10_animation/image/animation7.png.import new file mode 100644 index 0000000..bf223ca --- /dev/null +++ b/doc/demo10_animation/image/animation7.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/animation7.png-318a96e3f1d40580333aa3f3e1c4e254.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://doc/demo10_animation/image/animation7.png" +dest_files=[ "res://.import/animation7.png-318a96e3f1d40580333aa3f3e1c4e254.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/doc/demo10_animation/image/animation8.png b/doc/demo10_animation/image/animation8.png new file mode 100644 index 0000000..8fc69b8 Binary files /dev/null and b/doc/demo10_animation/image/animation8.png differ diff --git a/doc/demo10_animation/image/animation8.png.import b/doc/demo10_animation/image/animation8.png.import new file mode 100644 index 0000000..7ca5a46 --- /dev/null +++ b/doc/demo10_animation/image/animation8.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/animation8.png-d3676d524a1c638fc2c1bdb14b640470.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://doc/demo10_animation/image/animation8.png" +dest_files=[ "res://.import/animation8.png-d3676d524a1c638fc2c1bdb14b640470.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/doc/demo10_animation/image/animation9.png b/doc/demo10_animation/image/animation9.png new file mode 100644 index 0000000..f06d34f Binary files /dev/null and b/doc/demo10_animation/image/animation9.png differ diff --git a/doc/demo10_animation/image/animation9.png.import b/doc/demo10_animation/image/animation9.png.import new file mode 100644 index 0000000..7e818a2 --- /dev/null +++ b/doc/demo10_animation/image/animation9.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/animation9.png-4b5072688f929d27e7f9565737f2caaf.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://doc/demo10_animation/image/animation9.png" +dest_files=[ "res://.import/animation9.png-4b5072688f929d27e7f9565737f2caaf.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/doc/demo14_file/file.md b/doc/demo14_file/file.md index 18d7fdd..8278115 100644 --- a/doc/demo14_file/file.md +++ b/doc/demo14_file/file.md @@ -1,3 +1,4 @@ +# file文件系统 ![Image text](image/file1.png) ![Image text](image/file2.png) ![Image text](image/file3.png) @@ -5,3 +6,11 @@ ![Image text](image/file5.png) ![Image text](image/file6.png) ![Image text](image/file7.png) + + +# autoload单例模式 +![Image text](image/autoload1.png) +![Image text](image/autoload2.png) +![Image text](image/autoload3.png) +![Image text](image/autoload4.png) +![Image text](image/autoload5.png) diff --git a/doc/demo14_file/image/autoload1.png b/doc/demo14_file/image/autoload1.png new file mode 100644 index 0000000..ac1574b Binary files /dev/null and b/doc/demo14_file/image/autoload1.png differ diff --git a/doc/demo14_file/image/autoload1.png.import b/doc/demo14_file/image/autoload1.png.import new file mode 100644 index 0000000..e30f8a4 --- /dev/null +++ b/doc/demo14_file/image/autoload1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/autoload1.png-afd646f3d8d769a437b737e710545571.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://doc/demo14_file/image/autoload1.png" +dest_files=[ "res://.import/autoload1.png-afd646f3d8d769a437b737e710545571.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/doc/demo14_file/image/autoload2.png b/doc/demo14_file/image/autoload2.png new file mode 100644 index 0000000..fc1dd2f Binary files /dev/null and b/doc/demo14_file/image/autoload2.png differ diff --git a/doc/demo14_file/image/autoload2.png.import b/doc/demo14_file/image/autoload2.png.import new file mode 100644 index 0000000..9079580 --- /dev/null +++ b/doc/demo14_file/image/autoload2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/autoload2.png-703eb674c83b3852b6206ca2cbdae617.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://doc/demo14_file/image/autoload2.png" +dest_files=[ "res://.import/autoload2.png-703eb674c83b3852b6206ca2cbdae617.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/doc/demo14_file/image/autoload3.png b/doc/demo14_file/image/autoload3.png new file mode 100644 index 0000000..2a7aa98 Binary files /dev/null and b/doc/demo14_file/image/autoload3.png differ diff --git a/doc/demo14_file/image/autoload3.png.import b/doc/demo14_file/image/autoload3.png.import new file mode 100644 index 0000000..5bfdc2e --- /dev/null +++ b/doc/demo14_file/image/autoload3.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/autoload3.png-62bce05289b2141e879938c64fca24f3.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://doc/demo14_file/image/autoload3.png" +dest_files=[ "res://.import/autoload3.png-62bce05289b2141e879938c64fca24f3.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/doc/demo14_file/image/autoload4.png b/doc/demo14_file/image/autoload4.png new file mode 100644 index 0000000..269327d Binary files /dev/null and b/doc/demo14_file/image/autoload4.png differ diff --git a/doc/demo14_file/image/autoload4.png.import b/doc/demo14_file/image/autoload4.png.import new file mode 100644 index 0000000..e4c3ac9 --- /dev/null +++ b/doc/demo14_file/image/autoload4.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/autoload4.png-c01ee76da84561da13ad3f8778920018.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://doc/demo14_file/image/autoload4.png" +dest_files=[ "res://.import/autoload4.png-c01ee76da84561da13ad3f8778920018.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/doc/demo14_file/image/autoload5.png b/doc/demo14_file/image/autoload5.png new file mode 100644 index 0000000..33f1336 Binary files /dev/null and b/doc/demo14_file/image/autoload5.png differ diff --git a/doc/demo14_file/image/autoload5.png.import b/doc/demo14_file/image/autoload5.png.import new file mode 100644 index 0000000..c4c972a --- /dev/null +++ b/doc/demo14_file/image/autoload5.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/autoload5.png-86f79af8b019a1d00c8ba7e0a846959a.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://doc/demo14_file/image/autoload5.png" +dest_files=[ "res://.import/autoload5.png-86f79af8b019a1d00c8ba7e0a846959a.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/scene/demo10_animation/animation.tscn b/scene/demo10_animation/animation.tscn index 5b7bf77..f62ebc9 100644 --- a/scene/demo10_animation/animation.tscn +++ b/scene/demo10_animation/animation.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=14 format=2] +[gd_scene load_steps=16 format=2] [ext_resource path="res://scene/demo10_animation/image/run-6.png" type="Texture" id=1] [ext_resource path="res://scene/demo10_animation/image/run-5.png" type="Texture" id=2] @@ -10,6 +10,8 @@ [ext_resource path="res://scene/demo10_animation/image/run-3.png" type="Texture" id=8] [ext_resource path="res://scene/demo10_animation/image/run-1.png" type="Texture" id=9] [ext_resource path="res://scene/demo10_animation/image/run-2.png" type="Texture" id=10] +[ext_resource path="res://script/demo10_animation/timer_animation.gd" type="Script" id=11] +[ext_resource path="res://script/demo10_animation/tween_animation.gd" type="Script" id=12] [sub_resource type="Animation" id=1] resource_name = "my_animation_1" @@ -25,7 +27,7 @@ tracks/0/keys = { "times": PoolRealArray( 0, 2 ), "transitions": PoolRealArray( 1, 1 ), "update": 0, -"values": [ Vector2( 107.526, 131.125 ), Vector2( 863.129, 129.537 ) ] +"values": [ Vector2( 319.48, 335.423 ), Vector2( 966.209, 326.747 ) ] } tracks/1/type = "value" tracks/1/path = NodePath("icon:rotation_degrees") @@ -37,7 +39,7 @@ tracks/1/keys = { "times": PoolRealArray( 0, 2 ), "transitions": PoolRealArray( 1, 1 ), "update": 0, -"values": [ 0.0, 360.0 ] +"values": [ 0.0, 0.0 ] } tracks/2/type = "value" tracks/2/path = NodePath("icon:scale") @@ -49,7 +51,7 @@ tracks/2/keys = { "times": PoolRealArray( 0, 2 ), "transitions": PoolRealArray( 1, 1 ), "update": 0, -"values": [ Vector2( 1, 1 ), Vector2( 3, 3 ) ] +"values": [ Vector2( 1, 1 ), Vector2( 1, 1 ) ] } [sub_resource type="Animation" id=2] @@ -81,35 +83,64 @@ animations = [ { [node name="Animation_1" type="Node2D" parent="."] -[node name="icon" type="Sprite" parent="Animation_1"] -position = Vector2( 315.475, 141.204 ) -rotation = 6.28319 -scale = Vector2( 1.06651, 1.06651 ) -texture = ExtResource( 4 ) +[node name="Sprite" type="Sprite" parent="Animation_1"] +position = Vector2( 317.024, 70.0791 ) +scale = Vector2( 1.70913, 1.70913 ) +texture = ExtResource( 6 ) +hframes = 60 +script = ExtResource( 11 ) -[node name="AnimationPlayer" type="AnimationPlayer" parent="Animation_1"] -autoplay = "my_animation_1" -anims/my_animation_1 = SubResource( 1 ) +[node name="Timer" type="Timer" parent="Animation_1/Sprite"] +wait_time = 0.1 +autostart = true [node name="Animation_2" type="Node2D" parent="."] -[node name="player" type="Sprite" parent="Animation_2"] -position = Vector2( 317.132, 336.313 ) +[node name="Sprite" type="Sprite" parent="Animation_2"] +position = Vector2( 307.681, 157.511 ) +texture = ExtResource( 4 ) +script = ExtResource( 12 ) + +[node name="Tween" type="Tween" parent="Animation_2/Sprite"] +repeat = true +playback/repeat = true + +[node name="TargetPosition" type="Sprite" parent="."] +position = Vector2( 928.381, 170.859 ) +texture = ExtResource( 4 ) + +[node name="Animation_3" type="Node2D" parent="."] + +[node name="icon" type="Sprite" parent="Animation_3"] +position = Vector2( 317.477, 302.72 ) +texture = ExtResource( 4 ) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="Animation_3"] +autoplay = "my_animation_1" +anims/my_animation_1 = SubResource( 1 ) + +[node name="Animation_4" type="Node2D" parent="."] + +[node name="player" type="Sprite" parent="Animation_4"] +position = Vector2( 319.802, 425.747 ) scale = Vector2( 1.86179, 1.57452 ) texture = ExtResource( 6 ) hframes = 60 +frame = 5 -[node name="AnimationPlayer" type="AnimationPlayer" parent="Animation_2"] +[node name="AnimationPlayer" type="AnimationPlayer" parent="Animation_4"] autoplay = "animation_2" anims/animation_2 = SubResource( 2 ) -[node name="Animation_3" type="Node2D" parent="."] +[node name="Animation_5" type="Node2D" parent="."] position = Vector2( 308.251, 522.067 ) __meta__ = { "_edit_group_": true } -[node name="AnimatedSprite" type="AnimatedSprite" parent="Animation_3"] +[node name="AnimatedSprite" type="AnimatedSprite" parent="Animation_5"] frames = SubResource( 3 ) -frame = 5 +frame = 7 playing = true + +[connection signal="timeout" from="Animation_1/Sprite/Timer" to="Animation_1/Sprite" method="_on_Timer_timeout"] diff --git a/script/demo10_animation/timer_animation.gd b/script/demo10_animation/timer_animation.gd new file mode 100644 index 0000000..7bc8fcc --- /dev/null +++ b/script/demo10_animation/timer_animation.gd @@ -0,0 +1,9 @@ +extends Sprite + + + +func _on_Timer_timeout(): + if frame < 5: + frame += 1 + else: + frame = 0 diff --git a/script/demo10_animation/tween_animation.gd b/script/demo10_animation/tween_animation.gd new file mode 100644 index 0000000..3da2f34 --- /dev/null +++ b/script/demo10_animation/tween_animation.gd @@ -0,0 +1,15 @@ +extends Sprite + + +onready var tween = $Tween +onready var targetPosition = get_node("/root/Node2D/TargetPosition") + +# Called when the node enters the scene tree for the first time. +func _ready(): + tween.follow_property(self, "position", get_position(), targetPosition, "position", 2.0, Tween.TRANS_LINEAR, Tween.EASE_IN_OUT) + tween.start() + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +#func _process(delta): +# pass diff --git a/script/demo14_file/file.gd b/script/demo14_file/file.gd index 9415688..a7d15b0 100644 --- a/script/demo14_file/file.gd +++ b/script/demo14_file/file.gd @@ -18,16 +18,34 @@ func _ready() -> void: func saveData() -> void: - + var saveFile = File.new() + saveFile.open(filePath, File.WRITE) - FileUtils.writeStringToFile(filePath, content) + print(saveFile.get_path_absolute()) + + # bread and butter + saveFile.store_line(content) + saveFile.close() + + #FileUtils.writeStringToFile(filePath, content) func loadData() -> void: - - content = FileUtils.readFileToString(filePath) + var dataFile = File.new() + + # make sure our file exists on users system + if not dataFile.file_exists(filePath): + return # File does not exist + + # allow reading only for file + dataFile.open(filePath, File.READ) + + content = dataFile.get_as_text() + dataFile.close() + #content = FileUtils.readFileToString(filePath) +# 退出的时候回调 func _notification(what): if what == MainLoop.NOTIFICATION_WM_QUIT_REQUEST: content = content + TimeUtils.currentTimeMillis() as String