├── .current ├── samples ├── zygameui │ ├── zygame_spine_v4.2 │ │ ├── Assets │ │ │ ├── .gitignore │ │ │ ├── .DS_Store │ │ │ ├── ORole.png │ │ │ ├── 3.8 │ │ │ │ ├── ORole.png │ │ │ │ ├── magicThunder.png │ │ │ │ ├── ORole.atlas │ │ │ │ ├── magicThunder.atlas │ │ │ │ └── ORole.json │ │ │ ├── magicThunder.png │ │ │ ├── magicThunder.skel │ │ │ ├── snowglobe-pro.png │ │ │ ├── ORole.atlas │ │ │ ├── magicThunder.atlas │ │ │ ├── snowglobe-pro.atlas │ │ │ └── ORole.json │ │ ├── .DS_Store │ │ ├── zproject.xml │ │ ├── .vscode │ │ │ └── launch.json │ │ ├── project.xml │ │ ├── Spine42.hxproj │ │ └── Source │ │ │ └── Main.hx │ └── .DS_Store ├── .DS_Store ├── spine_old │ ├── .DS_Store │ ├── Assets │ │ ├── .DS_Store │ │ ├── test1.png │ │ ├── sxkCenter.png │ │ ├── btn_mianfeifuli.png │ │ ├── rote_cut │ │ │ ├── fx_saltCow2_skill.png │ │ │ ├── fx_saltCow2_skill.atlas │ │ │ └── fx_saltCow2_skill.json │ │ ├── unrote_cut │ │ │ ├── fx_saltCow2_skill.png │ │ │ ├── fx_saltCow2_skill.atlas │ │ │ └── fx_saltCow2_skill.json │ │ ├── test1.atlas │ │ ├── btn_mianfeifuli.atlas │ │ ├── test1.json │ │ ├── btn_mianfeifuli.json │ │ └── sxkCenter.atlas │ ├── .vscode │ │ ├── launch.json │ │ └── tasks.json │ ├── Source │ │ ├── FishSpineShader.hx │ │ ├── GPUMain.hx │ │ └── Main.hx │ └── project.xml └── spine_v4.2 │ ├── .DS_Store │ ├── Assets │ ├── .DS_Store │ ├── ORole.png │ ├── 3.8 │ │ ├── ORole.png │ │ ├── ORole.atlas │ │ └── ORole.json │ ├── snowglobe-pro.png │ ├── snowglobe-pro.skel │ ├── ORole.atlas │ ├── snowglobe-pro.atlas │ └── ORole.json │ ├── .vscode │ ├── launch.json │ └── tasks.json │ ├── Source │ ├── ui │ │ └── Button.hx │ └── Main.hx │ └── project.xml ├── .DS_Store ├── src_old ├── .DS_Store └── spine │ ├── .DS_Store │ ├── data │ └── ShareSkeleton.hx │ ├── openfl │ ├── CacheMode.hx │ ├── BitmapDataTextureLoader.hx │ ├── SkeletonAnimation.hx │ └── SkeletonSpriteBatchs.hx │ ├── utils │ ├── VectorUtils.hx │ └── JSONVersionUtils.hx │ ├── SkeletonDataFileHandle.hx │ ├── base │ └── SpineBaseDisplay.hx │ ├── SkeletonDataFileJsonHandle.hx │ ├── events │ ├── SpineEvent.hx │ └── AnimationEvent.hx │ ├── shader │ ├── SpineRenderBatchShader.hx │ └── SpineRenderShader.hx │ └── tilemap │ ├── BitmapDataTextureLoader.hx │ ├── SkeletonAnimation.hx │ ├── SkeletonSprite.hx │ └── BaseSkeletonDraw.hx ├── src_utils └── zygame │ └── utils │ ├── .DS_Store │ ├── StringUtils.hx │ ├── SpineManager.hx │ └── load │ └── SpineTextureAtlasLoader.hx ├── README.md ├── .gitignore ├── haxelib.json ├── src └── spine │ ├── utils │ └── VectorUtils.hx │ ├── base │ └── SpineBaseDisplay.hx │ ├── events │ ├── SpineEvent.hx │ └── AnimationEvent.hx │ ├── openfl │ └── BitmapDataTextureLoader.hx │ ├── shader │ └── SpineRenderShader.hx │ └── tilemap │ ├── BitmapDataTextureLoader.hx │ ├── SkeletonAnimation.hx │ ├── SkeletonSprite.hx │ └── BaseSkeletonDraw.hx ├── vscode.hxml ├── vscode-old.hxml ├── include.xml ├── LICENSE.md ├── CHANGELOG.md ├── README_zh.md └── README_en.md /.current: -------------------------------------------------------------------------------- 1 | 1.8.3 -------------------------------------------------------------------------------- /samples/zygameui/zygame_spine_v4.2/Assets/.gitignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/.DS_Store -------------------------------------------------------------------------------- /samples/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/.DS_Store -------------------------------------------------------------------------------- /src_old/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/src_old/.DS_Store -------------------------------------------------------------------------------- /src_old/spine/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/src_old/spine/.DS_Store -------------------------------------------------------------------------------- /samples/zygameui/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/zygameui/.DS_Store -------------------------------------------------------------------------------- /samples/spine_old/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/spine_old/.DS_Store -------------------------------------------------------------------------------- /samples/spine_v4.2/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/spine_v4.2/.DS_Store -------------------------------------------------------------------------------- /samples/spine_old/Assets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/spine_old/Assets/.DS_Store -------------------------------------------------------------------------------- /samples/spine_old/Assets/test1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/spine_old/Assets/test1.png -------------------------------------------------------------------------------- /src_utils/zygame/utils/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/src_utils/zygame/utils/.DS_Store -------------------------------------------------------------------------------- /samples/spine_v4.2/Assets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/spine_v4.2/Assets/.DS_Store -------------------------------------------------------------------------------- /samples/spine_v4.2/Assets/ORole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/spine_v4.2/Assets/ORole.png -------------------------------------------------------------------------------- /samples/spine_old/Assets/sxkCenter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/spine_old/Assets/sxkCenter.png -------------------------------------------------------------------------------- /samples/spine_v4.2/Assets/3.8/ORole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/spine_v4.2/Assets/3.8/ORole.png -------------------------------------------------------------------------------- /src_old/spine/data/ShareSkeleton.hx: -------------------------------------------------------------------------------- 1 | package spine.data; 2 | 3 | /** 4 | * 共享骨架 5 | */ 6 | class ShareSkeleton extends Skeleton {} 7 | -------------------------------------------------------------------------------- /samples/spine_old/Assets/btn_mianfeifuli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/spine_old/Assets/btn_mianfeifuli.png -------------------------------------------------------------------------------- /samples/spine_v4.2/Assets/snowglobe-pro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/spine_v4.2/Assets/snowglobe-pro.png -------------------------------------------------------------------------------- /samples/spine_v4.2/Assets/snowglobe-pro.skel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/spine_v4.2/Assets/snowglobe-pro.skel -------------------------------------------------------------------------------- /samples/zygameui/zygame_spine_v4.2/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/zygameui/zygame_spine_v4.2/.DS_Store -------------------------------------------------------------------------------- /src_old/spine/openfl/CacheMode.hx: -------------------------------------------------------------------------------- 1 | package spine.openfl; 2 | 3 | enum CacheMode { 4 | // 三角形数据 5 | TRIANGLES; 6 | // 图形数据缓存 7 | SHAPE; 8 | } 9 | -------------------------------------------------------------------------------- /samples/zygameui/zygame_spine_v4.2/Assets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/zygameui/zygame_spine_v4.2/Assets/.DS_Store -------------------------------------------------------------------------------- /samples/zygameui/zygame_spine_v4.2/Assets/ORole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/zygameui/zygame_spine_v4.2/Assets/ORole.png -------------------------------------------------------------------------------- /samples/spine_old/Assets/rote_cut/fx_saltCow2_skill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/spine_old/Assets/rote_cut/fx_saltCow2_skill.png -------------------------------------------------------------------------------- /samples/zygameui/zygame_spine_v4.2/Assets/3.8/ORole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/zygameui/zygame_spine_v4.2/Assets/3.8/ORole.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Openfl-Spine 2 | 用于OpenFL引擎渲染的Spine渲染器 3 | ### 版本支持 4 | 最低运行时支持版本:3.6.0 5 | 最新运行时版本支持:4.2.0 6 | 7 | ### 文档 8 | [中文](README_zh.md) 9 | [English](README_en.md) -------------------------------------------------------------------------------- /samples/spine_old/Assets/unrote_cut/fx_saltCow2_skill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/spine_old/Assets/unrote_cut/fx_saltCow2_skill.png -------------------------------------------------------------------------------- /samples/zygameui/zygame_spine_v4.2/Assets/magicThunder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/zygameui/zygame_spine_v4.2/Assets/magicThunder.png -------------------------------------------------------------------------------- /samples/zygameui/zygame_spine_v4.2/Assets/magicThunder.skel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/zygameui/zygame_spine_v4.2/Assets/magicThunder.skel -------------------------------------------------------------------------------- /samples/zygameui/zygame_spine_v4.2/Assets/snowglobe-pro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/zygameui/zygame_spine_v4.2/Assets/snowglobe-pro.png -------------------------------------------------------------------------------- /samples/zygameui/zygame_spine_v4.2/Assets/3.8/magicThunder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rainyt/openfl-spine/HEAD/samples/zygameui/zygame_spine_v4.2/Assets/3.8/magicThunder.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .dev 3 | Export 4 | samples/.vscode 5 | samples/Assets/symZ_expand.atlas 6 | samples/Assets/symZ_expand.json 7 | samples/Assets/symZ_expand.png 8 | src/.DS_Store 9 | zygame-src/zygame/utils/.DS_Store 10 | zygame-src/zygame/utils/load/.DS_Store 11 | src/spine/openfl/.DS_Store 12 | src/spine/.DS_Store 13 | samples/Assets/.DS_Store 14 | -------------------------------------------------------------------------------- /haxelib.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "openfl-spine", 3 | "url": "https://github.com/rainyt/OpenFLSpine", 4 | "license": "MIT", 5 | "tags": ["spine","tilemap","openfl"], 6 | "description": "Spine render", 7 | "version": "4.2.0", 8 | "releasenote": "Improve darkColor.", 9 | "contributors": ["rainy"], 10 | "classPath": "src", 11 | "dependencies": { 12 | 13 | } 14 | } -------------------------------------------------------------------------------- /src/spine/utils/VectorUtils.hx: -------------------------------------------------------------------------------- 1 | package spine.utils; 2 | 3 | import openfl.Vector; 4 | 5 | class VectorUtils { 6 | public static function pushVectorFloat(v:Vector, v2:Vector):Void { 7 | for (i in 0...v2.length) 8 | v.push(v2[i]); 9 | } 10 | 11 | public static function pushVectorInt(v:Vector, v2:Vector):Void { 12 | for (i in 0...v2.length) 13 | v.push(v2[i]); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /samples/spine_old/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // 使用 IntelliSense 了解相关属性。 3 | // 悬停以查看现有属性的描述。 4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Flash", 9 | "type": "fdb", 10 | "request": "launch", 11 | "program": "${workspaceRoot}/Export/flash/bin/ZYGameEngineHaxe.swf" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /samples/zygameui/zygame_spine_v4.2/zproject.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src_old/spine/utils/VectorUtils.hx: -------------------------------------------------------------------------------- 1 | package spine.utils; 2 | 3 | import openfl.Vector; 4 | 5 | class VectorUtils { 6 | 7 | public static function pushVectorFloat(v:Vector,v2:Vector):Void 8 | { 9 | for(i in 0...v2.length) 10 | v.push(v2[i]); 11 | } 12 | 13 | public static function pushVectorInt(v:Vector,v2:Vector):Void 14 | { 15 | for(i in 0...v2.length) 16 | v.push(v2[i]); 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /samples/zygameui/zygame_spine_v4.2/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // 使用 IntelliSense 了解相关属性。 3 | // 悬停以查看现有属性的描述。 4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "chrome", 9 | "request": "launch", 10 | "name": "针对 localhost 启动 Chrome", 11 | "url": "http://localhost:3005", 12 | "webRoot": "${workspaceFolder}" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /samples/spine_v4.2/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // 使用 IntelliSense 了解相关属性。 3 | // 悬停以查看现有属性的描述。 4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "chrome", 9 | "request": "launch", 10 | "name": "HTML5(PC测试模式/)", 11 | "url": "http://localhost:3003", 12 | "webRoot": "${workspaceFolder}", 13 | }, 14 | 15 | 16 | ] 17 | } -------------------------------------------------------------------------------- /src_old/spine/SkeletonDataFileHandle.hx: -------------------------------------------------------------------------------- 1 | package spine; 2 | 3 | class SkeletonDataFileHandle implements spine.support.files.FileHandle { 4 | 5 | public var path:String = ""; 6 | 7 | private var _data:String; 8 | 9 | public function new(path:String,data:String = null){ 10 | this.path = path; 11 | if(this.path == null) 12 | this.path = ""; 13 | _data = data; 14 | if(_data == null) 15 | _data = openfl.Assets.getText(path); 16 | } 17 | 18 | public function getContent():String{ 19 | return _data; 20 | } 21 | 22 | } -------------------------------------------------------------------------------- /samples/zygameui/zygame_spine_v4.2/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /samples/spine_v4.2/Assets/ORole.atlas: -------------------------------------------------------------------------------- 1 | ORole.png 2 | size:256,128 3 | filter:Linear,Linear 4 | pma:true 5 | scale:0.4 6 | Body 7 | bounds:204,65,17,59 8 | Head 9 | bounds:156,78,46,46 10 | LeftHand1 11 | bounds:2,2,38,18 12 | LeftHand2 13 | bounds:88,35,38,18 14 | LeftLeg1 15 | bounds:88,55,32,69 16 | LeftLeg2 17 | bounds:2,22,41,102 18 | LeftLeg3 19 | bounds:223,97,26,27 20 | RightHand2 21 | bounds:156,58,38,18 22 | RightHend1 23 | bounds:42,2,38,18 24 | RightLeg1 25 | bounds:122,55,32,69 26 | RightLeg2 27 | bounds:45,22,41,102 28 | RightLeg3 29 | bounds:223,68,26,27 30 | -------------------------------------------------------------------------------- /samples/zygameui/zygame_spine_v4.2/Assets/ORole.atlas: -------------------------------------------------------------------------------- 1 | ORole.png 2 | size:256,128 3 | filter:Linear,Linear 4 | pma:true 5 | scale:0.4 6 | Body 7 | bounds:204,65,17,59 8 | Head 9 | bounds:156,78,46,46 10 | LeftHand1 11 | bounds:2,2,38,18 12 | LeftHand2 13 | bounds:88,35,38,18 14 | LeftLeg1 15 | bounds:88,55,32,69 16 | LeftLeg2 17 | bounds:2,22,41,102 18 | LeftLeg3 19 | bounds:223,97,26,27 20 | RightHand2 21 | bounds:156,58,38,18 22 | RightHend1 23 | bounds:42,2,38,18 24 | RightLeg1 25 | bounds:122,55,32,69 26 | RightLeg2 27 | bounds:45,22,41,102 28 | RightLeg3 29 | bounds:223,68,26,27 30 | -------------------------------------------------------------------------------- /samples/spine_old/Assets/test1.atlas: -------------------------------------------------------------------------------- 1 | 2 | test1.png 3 | size: 256,256 4 | format: RGBA8888 5 | filter: Linear,Linear 6 | repeat: none 7 | 白 8 | rotate: false 9 | xy: 2, 2 10 | size: 55, 216 11 | orig: 55, 216 12 | offset: 0, 0 13 | index: -1 14 | 红 15 | rotate: false 16 | xy: 59, 2 17 | size: 55, 216 18 | orig: 55, 216 19 | offset: 0, 0 20 | index: -1 21 | 蓝 22 | rotate: false 23 | xy: 116, 2 24 | size: 55, 216 25 | orig: 55, 216 26 | offset: 0, 0 27 | index: -1 28 | 黄 29 | rotate: false 30 | xy: 173, 2 31 | size: 55, 216 32 | orig: 55, 216 33 | offset: 0, 0 34 | index: -1 35 | -------------------------------------------------------------------------------- /vscode.hxml: -------------------------------------------------------------------------------- 1 | # -main zygame.core.Start 2 | --library zygameui 3 | --library zygameui-api 4 | --library openfl 5 | --library lime 6 | # --library spine-hx 7 | --library spine-haxe 8 | --library castle 9 | --library hscript 10 | --library tweenxcore 11 | --library crypto 12 | --library KengSDK 13 | --library feathersui 14 | --library swf 15 | --library differ 16 | --library vector-math 17 | --library openfl-glsl 18 | --library openfl-spine 19 | --library openfl-gpu-particles 20 | -D vscode 21 | -D zygame 22 | -D api 23 | -D openfl_swf 24 | -lib KengSDK 25 | -cp src 26 | -cp openfl9-source 27 | -cp zygame-src 28 | --js bin/main.js 29 | --no-output -------------------------------------------------------------------------------- /vscode-old.hxml: -------------------------------------------------------------------------------- 1 | # -main zygame.core.Start 2 | --library zygameui 3 | --library zygameui-api 4 | --library openfl 5 | --library lime 6 | --library spine-hx 7 | # --library spine-haxe 8 | --library castle 9 | --library hscript 10 | --library tweenxcore 11 | --library crypto 12 | --library KengSDK 13 | --library feathersui 14 | --library swf 15 | --library differ 16 | --library vector-math 17 | --library openfl-glsl 18 | --library openfl-spine 19 | --library openfl-gpu-particles 20 | -D vscode 21 | -D zygame 22 | -D api 23 | -D openfl_swf 24 | -lib KengSDK 25 | -cp src_old 26 | -cp openfl9-source 27 | -cp zygame-src 28 | --js bin/main.js 29 | --no-output -------------------------------------------------------------------------------- /samples/spine_v4.2/Source/ui/Button.hx: -------------------------------------------------------------------------------- 1 | package ui; 2 | 3 | import openfl.text.TextFormat; 4 | import openfl.text.TextField; 5 | import openfl.display.Sprite; 6 | 7 | /** 8 | * 按钮 9 | */ 10 | class Button extends Sprite { 11 | public function new(text:String) { 12 | super(); 13 | this.graphics.beginFill(0xd6d6d6); 14 | this.graphics.drawRoundRect(0, 0, 80, 32, 12, 12); 15 | this.graphics.endFill(); 16 | 17 | var textField = new TextField(); 18 | this.addChild(textField); 19 | textField.width = 80; 20 | textField.text = text; 21 | textField.setTextFormat(new TextFormat(null, 20, 0x0, null, null, null, null, null, CENTER)); 22 | textField.mouseEnabled = false; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/spine/base/SpineBaseDisplay.hx: -------------------------------------------------------------------------------- 1 | package spine.base; 2 | 3 | interface SpineBaseDisplay { 4 | /** 5 | * 是否可见 6 | */ 7 | public var visible(get, set):Bool; 8 | 9 | /** 10 | * 是否正在播放 11 | */ 12 | public var isPlay(get, set):Bool; 13 | 14 | /** 15 | * 是否不可见 16 | * @return Bool 17 | */ 18 | public function isHidden():Bool; 19 | 20 | /** 21 | * Spine渲染 22 | * @param dt 23 | */ 24 | public function onSpineUpdate(dt:Float):Void; 25 | 26 | /** 27 | * 是否为独立运行,不受SpineManager的影响 28 | */ 29 | public var independent:Bool; 30 | 31 | /** 32 | * 最后绘制时间 33 | */ 34 | public var lastDrawTime:Float; 35 | 36 | #if zygame 37 | public var customData:Dynamic; 38 | #end 39 | } 40 | -------------------------------------------------------------------------------- /src_old/spine/base/SpineBaseDisplay.hx: -------------------------------------------------------------------------------- 1 | package spine.base; 2 | 3 | interface SpineBaseDisplay { 4 | /** 5 | * 是否可见 6 | */ 7 | public var visible(get, set):Bool; 8 | 9 | /** 10 | * 是否正在播放 11 | */ 12 | public var isPlay(get, set):Bool; 13 | 14 | /** 15 | * 是否不可见 16 | * @return Bool 17 | */ 18 | public function isHidden():Bool; 19 | 20 | /** 21 | * Spine渲染 22 | * @param dt 23 | */ 24 | public function onSpineUpdate(dt:Float):Void; 25 | 26 | /** 27 | * 是否为独立运行,不受SpineManager的影响 28 | */ 29 | public var independent:Bool; 30 | 31 | /** 32 | * 最后绘制时间 33 | */ 34 | public var lastDrawTime:Float; 35 | 36 | #if zygame 37 | public var customData:Dynamic; 38 | #end 39 | } 40 | -------------------------------------------------------------------------------- /samples/spine_old/Source/FishSpineShader.hx: -------------------------------------------------------------------------------- 1 | package; 2 | 3 | import spine.shader.SpineRenderShader; 4 | import VectorMath; 5 | 6 | /** 7 | * 鱼的着色器 8 | */ 9 | class FishSpineShader extends SpineRenderShader { 10 | 11 | override function fragment() { 12 | super.fragment(); 13 | gl_FragColor = color * alphaBlendMode.x; 14 | gl_FragColor.a = gl_FragColor.a * (1 - alphaBlendMode.y); 15 | gl_FragColor.rgb = gl_FragColor.rgb * mulcolor.rgb; 16 | gl_FragColor = gl_FragColor * malpha; 17 | // 取灰度 18 | var h:Float = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3; 19 | gl_FragColor.rgb = vec3(h) * vec3(0.7, 1, 1); 20 | // 然后变亮 21 | gl_FragColor.rgba += vec4(0.2) * gl_FragColor.a; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /include.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src_utils/zygame/utils/StringUtils.hx: -------------------------------------------------------------------------------- 1 | package zygame.utils; 2 | 3 | /** 4 | * 字符串工具 5 | */ 6 | class StringUtils { 7 | /** 8 | * 获取字符串的扩展名,如果不存在扩展名,则会返回null 9 | * @param data - 10 | * @return String 11 | */ 12 | public static function getExtType(data:String):String { 13 | if (data == null) 14 | return data; 15 | var index:Int = data.lastIndexOf("."); 16 | return index == -1 ? null : data.substr(index + 1); 17 | } 18 | 19 | /** 20 | * 获取字符串的名字,不带路径、扩展名 21 | * @param data - 22 | * @return String 23 | */ 24 | public static function getName(data:String):String { 25 | if (data == null) 26 | return data; 27 | data = data.substr(data.lastIndexOf("/") + 1); 28 | data = data.substr(0, data.lastIndexOf(".")); 29 | return data; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /samples/spine_v4.2/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |