Page 1 of 1

[Request] 9-Patch shader for sprites

PostPosted: Sat Apr 08, 2017 6:29 pm
by matriax
Since 9-patch not have animations, frames and can't be rotated, is possible do a shader that applied on a Sprite plugin makes the same and maybe more things?

Is possible?

Re: [Request] 9-Patch shader for sprites

PostPosted: Wed Apr 12, 2017 12:02 pm
by matriax
Nothing?

@gigatron is possible with the actual shaders in C2 ?

Re: [Request] 9-Patch shader for sprites

PostPosted: Wed Apr 12, 2017 4:09 pm
by Gigatron
@matriax
matriax wrote:Nothing?

@gigatron is possible with the actual shaders in C2 ?

I don't really know what 9 Patch do ....
I like images pictures for goal ... my english is not good you know ; so what exactly you want ?

Thanks

Re: [Request] 9-Patch shader for sprites

PostPosted: Wed Apr 12, 2017 5:05 pm
by matriax
Hi @Gigatron

9-Patch is a C2 default plugin , is hard to explain so better try and see how they works.

The problem about this plugin as i said is that not allow animation/frames and not allow rotations, so the idea is use a Sprite plugin instead with a shader that allos the same option to have the ability to ass frames/animation and rotations.

Basically 9-patch get the image you add and rip in 9 parts like:
123
456
789

In the plugin properties you set how this image is Tile-based with pixel width/height in left/right/top/bottom and if they will work as tiles, stretch or how. Is hard to explain better see the 9-Patch official manual here:

https://www.scirra.com/manual/151/9-patch

So the idea is that, in case is possible, do a shader that can do the shame for a sprite image.

Re: [Request] 9-Patch shader for sprites

PostPosted: Thu Apr 13, 2017 4:34 pm
by Gigatron
@matriax

I understand what 9patch do now : when you set all margins value to 1 you have the original sprite,
in this case i see it's streching corners to mask the edge... so in glsl i ve done something similar ;
Sure you will find something wrong :)
quickly :
http://gigatron3k.free.fr/html5/C2/FX/9patch.rar

Re: [Request] 9-Patch shader for sprites

PostPosted: Thu Apr 13, 2017 5:30 pm
by matriax
Hi @gigatron

I updated your .capx adding an example in 9patch of what the shader needs to do to works the best:

https://drive.google.com/file/d/0B8vm3F ... sp=sharing

In the grass example you can resize in X or Y and no matter always looks pixel-perfect.

Maybe i'm asking too much for a shader ? :S

Re: [Request] 9-Patch shader for sprites

PostPosted: Fri Apr 28, 2017 7:24 am
by matriax
Hi @gigatron , any news about this?

Re: [Request] 9-Patch shader for sprites

PostPosted: Fri Apr 28, 2017 2:22 pm
by Gigatron
matriax wrote:Hi @gigatron , any news about this?


I am working on it ... and on diffents projects in the same time ... please wait :)