[Request] 9-Patch shader for sprites

Share your Construct 2 effect files

Post » Sat Apr 08, 2017 6:29 pm

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?
B
26
S
10
G
3
Posts: 584
Reputation: 4,595

Post » Wed Apr 12, 2017 12:02 pm

Nothing?

@gigatron is possible with the actual shaders in C2 ?
B
26
S
10
G
3
Posts: 584
Reputation: 4,595

Post » Wed Apr 12, 2017 4:09 pm

@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
B
67
S
24
G
29
Posts: 827
Reputation: 22,677

Post » Wed Apr 12, 2017 5:05 pm

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.
B
26
S
10
G
3
Posts: 584
Reputation: 4,595

Post » Thu Apr 13, 2017 4:34 pm

@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
B
67
S
24
G
29
Posts: 827
Reputation: 22,677

Post » Thu Apr 13, 2017 5:30 pm

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
B
26
S
10
G
3
Posts: 584
Reputation: 4,595

Post » Fri Apr 28, 2017 7:24 am

Hi @gigatron , any news about this?
B
26
S
10
G
3
Posts: 584
Reputation: 4,595

Post » Fri Apr 28, 2017 2:22 pm

matriax wrote:Hi @gigatron , any news about this?


I am working on it ... and on diffents projects in the same time ... please wait :)
B
67
S
24
G
29
Posts: 827
Reputation: 22,677


Return to Effects

Who is online

Users browsing this forum: No registered users and 1 guest