How do I make an outline for a sprite.

Get help using Construct 2

Post » Thu Feb 04, 2016 5:17 pm

Image
Image
I did this... I manually create new sprites for the player and position them around the player with few pixels offset to all the eight directions. Set the mirror and frame to same than the host. Yeah.

Problems:
1) It works but I'm extremely worried if any game can run this if I'm creating outlines for my player, maybe max 15 enemies at once and also items that drop from dead enemies and some possible item pickups... So think anything from 1 to 20 sprites at once having 8 copies. Is that much?

2) Also I want to know if there is any easier way to achieve this and, how to I create this all for all my other sprites easily.

Thanks for reading!
B
10
S
2
G
1
Posts: 51
Reputation: 848

Post » Thu Feb 04, 2016 5:22 pm

I think the outline effect does the same (moving into 8 directions to create the outline). So it might still be slow, but at least it is easier on your code.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Thu Feb 04, 2016 5:56 pm

mindfaQ wrote:I think the outline effect does the same (moving into 8 directions to create the outline). So it might still be slow, but at least it is easier on your code.


Ah right I forgot to mention. I found that with google. And anyway the last pages were just comments on it not being working (like some said it works in preview but not in export) so I assume the creator abandoned the code? I downloaded it and it just gave me an error when I tried to start C2 so it doesn't work.
B
10
S
2
G
1
Posts: 51
Reputation: 848

Post » Thu Feb 04, 2016 6:12 pm

For me it works, but I have not tried it with every exporter.
(edit: seems to be compatible with nw.js)
Last edited by mindfaQ on Thu Feb 04, 2016 6:22 pm, edited 1 time in total.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Thu Feb 04, 2016 6:22 pm

Why not just create your graphics with outlines?

Another option would be to use the paster object to only create outlines for the stuff on screen. Basically paste all the objects you want to have an outline to it. Make it all black by pasting a all black object to it with a blend mode. Then finally pasting it to a second object in all 8 directions.

The shader would likely be the fastest. I don't use webgl anymore so I haven't touched the effect in a while.
B
94
S
33
G
113
Posts: 5,353
Reputation: 73,267

Post » Thu Feb 04, 2016 6:47 pm

mindfaQ wrote:For me it works, but I have not tried it with every exporter.
(edit: seems to be compatible with nw.js)


It gives this error: "Unable to load plugin in 'C:\Program Files\Construct 2\exporters\html5\plugins\outline\': Cannot open file 'C:\Program Files\Construct 2\exporters\html5\plugins\outline\common.js'
This plugin will not be available in the editor.
Am I putting it in the wrong folder or something? I haven't tried to install plugins before.

R0J0hound wrote:Why not just create your graphics with outlines?

Another option would be to use the paster object to only create outlines for the stuff on screen. Basically paste all the objects you want to have an outline to it. Make it all black by pasting a all black object to it with a blend mode. Then finally pasting it to a second object in all 8 directions.

The shader would likely be the fastest. I don't use webgl anymore so I haven't touched the effect in a while.


Well I don't want the outline to overlap with the actual graphics so they all should run in the background so I can't create them with outlines.

I will look into that other option you talked about. I'm not to experienced with any of that but I will see what I can do by myself.
B
10
S
2
G
1
Posts: 51
Reputation: 848

Post » Thu Feb 04, 2016 6:48 pm

Place it in C:\Program Files\Construct 2\effects

It is a webgl effect. If you need to support canvas2d, then you need to do something like R0j0hound suggested or keep using your solution, I think.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Thu Feb 04, 2016 6:54 pm

Oh um, there is a webGL effect called Toon that should create outlines, but I'm not quite sure why its not making them on my objects... I will try and figure this out lol
B
10
S
2
G
1
Posts: 51
Reputation: 848

Post » Thu Feb 04, 2016 7:17 pm

Toon doesn't create outlines of objects.

Here's a non-webgl way to do outlines with the paster object.
https://dl.dropboxusercontent.com/u/542 ... tline.capx
B
94
S
33
G
113
Posts: 5,353
Reputation: 73,267

Post » Thu Feb 04, 2016 7:27 pm

R0J0hound wrote:Toon doesn't create outlines of objects.

Here's a non-webgl way to do outlines with the paster object.
https://dl.dropboxusercontent.com/u/542 ... tline.capx


I wrote a rly long post but I somehow managed to lose it since I had to sign in again when I was trying to post it?? Either way, this is exactly what I am after and I am so glad to see this!

Thank you so much! :>
B
10
S
2
G
1
Posts: 51
Reputation: 848

Next

Return to How do I....?

Who is online

Users browsing this forum: Cubeeo and 7 guests