Closed CrazyFlasher closed 3 years ago
This is the same problem as changing the color, and Openfl has a suitable API to implement.
It has, or hasn't?
It seems that it cannot be implemented directly by the drawTriangles method. I have no good ideas.
If possible, you can try rendering with tilemap, which supports transparency, color changes I am not sure if it works.
I've just tested with tilemap. Tilemap skeleton does not support color transform :( Can it be fixed? wild.zip
Also can I combine tilesets to render them on 1 tilemap?
Also there are problems with stripwhitespace is on sesame_shiba.zip
May be those issues can be fixed, like you did for sprite skeleton?
https://github.com/rainyt/openfl-spine/commit/a6dd0e6b11a2fb1a57b1a54fae4c04e4213dbf0c
You can use the texture packer to generate a sprite sheet to render different Spines. Added support for color changes above.
Does the sesame_shiba.zip file occur in a Sprite or a Tilemap?
Thanks, I'll check soon. Sesame shibe works with sprite skeleton fine
Ok, I've tested. Color transform works now fine, but animations with "strip whitespace on", are broken using tilemap skeleton:
"Strip whitespace on" works fine with sprite skeletons:
Tilemap skeletons with color transform give a lot of drawcalls anyways. But much less than sprite skeleron with isNative true Code
SpineManager.init(stage);
var m:IntMap<String> = new IntMap<String>();
var animBasePath:String = "anims/";
m.set(0, animBasePath + "bonus/bonus");
m.set(1, animBasePath + "White_shiba/white_shiba");
m.set(2, animBasePath + "Black_shiba/black_shiba");
m.set(3, animBasePath + "Red_shiba/red_shiba");
m.set(4, animBasePath + "Seasame_Shiba/sesame_shiba");
m.set(5, animBasePath + "A/A");
m.set(6, animBasePath + "K/K");
m.set(7, animBasePath + "Q/Q");
m.set(8, animBasePath + "J/J");
m.set(9, animBasePath + "10/10");
m.set(10, animBasePath + "wild/wild");
var x:Float = 100;
var y:Float = 200;
var vo:SpineVo = SpineAssets.get(m.get(4));
var tm:Tilemap = new Tilemap(1000, 1000, vo.atlas.loader.getTileset());
for (i in 0...50)
{
var s:SkeletonAnimation = vo.atlas.buildTilemapSkeleton(null, vo.jsonData);
tm.addTile(s);
s.scaleX = s.scaleY = 0.3;
s.x = x;
s.y = y;
s.play("animation");
x += 100;
if (x > 900)
{
x = 100;
y += 100;
}
}
stage.addChild(tm);
}
I am busy today, I may have to spend some time on strip whitespace on. The drawcall of a tilemap may be caused by a color change
Thank you very much though! I'll ask animators to re-export sources with turned off strip whitespace
这个动画也有问题:
Sprite isNative true-确定
拼贴图-错误
https://github.com/rainyt/openfl-spine/commit/13f41e566573bd2562dba2a2e1aada87823ae041 Fix this problem.
I ❤️ you 😄 !
Hi. Sorry for bothering. Any success with strip whitespace on and tilemaps? :)
No, I haven't found an effective solution yet.
Hi again. Got some issues with animation (tilemaps).
There are several scales: 1, 0.5, 0.25. 0.5 - OK 0.25 - OK 1 - Broken
Animation with scale 1 has 3 pngs. May be it's related to it?
Only isNative supports multiple image loading, and all images need to be loaded when loading.
Ok. I lower export size to fit. Stripwhitespace would help in this case :)
Now, !isNaitve support:
openfl-spine Update to 1.6.0
haxelib update openfl-spine haxelib install openfl-glsl 1、Deprecated: The isNative rendering support of SpriteSpine is no longer supported, and it is invalid by default; if there is still a need, please refer to multipleTextureRender multi-texture rendering support. 2、Improvement: Added the SpineRenderShader shader, improved the SpriteSpine rendering, and now has added support for transparency, BlendMode.ADD, color modification, etc. (mesh supports at the same time). 3、Dependency: Need to depend on the openfl-glsl library.
@CrazyFlasher
The current function is already supported.
It would be cool the have possibility to specify alpha threshold, when image will be invisible. Currently !isNative doesn't support color or alpha transform. So that would be helpful feature.