Dr.House Posted March 2, 2014 Author Share Posted March 2, 2014 Hello EclipseI'm working on a game and I want to know if it possible trough coding to add a black outline to a Sprite.Something like "Stroke" in Photoshop even when scalled down the image the stroke/outline will nicely adjust to the image.Imagine for example ROTMG sprites without that black outline, and I add trough coding x1 Pixel Black Outline, wich will adjust nicely even if the sprite changes size for example from 60x60 to 30x30 or whatever, but will keep that nice 1px black outline.So, is this possible? In **JS**If yes, it is something complicated ?Thank you! Link to comment Share on other sites More sharing options...
Matt Posted March 2, 2014 Share Posted March 2, 2014 It would be nice to know what graphics library you're using. However, If it is possible with said graphics library, I wouldn't know how to do it. Good luck though! Link to comment Share on other sites More sharing options...
Seb Posted March 2, 2014 Share Posted March 2, 2014 Is this for bad mens? Link to comment Share on other sites More sharing options...
Exception Posted March 2, 2014 Share Posted March 2, 2014 You have two options, the simple (or lazy, depending on your outlook) option, and the technically correct option.The simple option is to simply redraw the image 4/8 times offset by 1 pixel (up/down/left/right and optionally up-left/up-right/down-left/down-right) and make them filled black. Obviously, this will impact performance. Test extensively if you try this out.Your technically correct option (but isn't necessarily always possible, depends on whether your graphics engine allows it), is to look up some shader options. WebGL certainly allows you to use shaders, dunno about anything else.I can't provide any shader code, I'm useless at creating them. :p Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now