How do I make an outline for a sprite.

  • 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!

  • 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.

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • For me it works, but I have not tried it with every exporter.

    (edit: seems to be compatible with nw.js)

  • 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.

  • 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.

    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.

  • 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.

  • 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

  • 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

  • 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! :>

  • Ah, my pretty placeholder art in all its outlined glory.

    Hey, how can I prevent newly spawned objects to have a outline too? Is there a way to reset the canvas?That black box should look the same than the orange ones.

    Edit: nvm I was just creating the objects on the wrong layer.

  • I really like the outline effect but i run into a problem that if i make the paster big enough to cover my whole canvas it makes my game lag like crazy (multiple objects need pasting etc.) So i was wondering that if i were possible to have it stay on my hud layer and move when i move so it only needs to paste the sprites that are visible, but i really just cant get that to work. Could someone help me out?

  • Put the paster on a layer with a parallax of 0,0, and make it only the size of the screen. Then you could use the is on screen conditions before pasting the objects.

  • http://imgur.com/a/Co0qg

    That is what I did but this is my end result. The reason why the sprite overlaps the outline while jumping is because on that point the view is on the very top left part of the map and has not scrolled anywhere.

    What is causing this offshift?

  • Oh, ok. do this instead: give the layer a paralax of 100x100, and make the hotspot of the paster be the center, then right before pasting the objects to it set it's position to scollx,scrolly.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)