Skip to content

A flexible, option filled, 2D outline solution, that works for both concave and convex sprites and is editable in Play Mode.

Notifications You must be signed in to change notification settings

b-cancel/Unity3D_2DOutlineKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 

Repository files navigation

Unity3D_2DOutlineKit_INPROG

If this project helped you reduce developement time or you just want to help me continue making useful tools
Feel free to buy me a cup of coffee! :)
PayPal Donate Button

How To Use

  • for a convex sprite, drag the "convexOut" script into the gameobject or add it as a component
  • for a concave sprite, drag the "concaveOut" script into the gameobject or add it as a component

All Test Basic Tests and Features

  • Basics
    • viewable in scene view
    • viewable in game view
    • viewable in edit mode
    • viewable in game mode
  • Camera
    • both perspective and orthographic mode
    • all rendering paths
    • occlusion culling (on or off)
    • allow hdr (on or off)
    • allow msaa (on or off)
    • allow dynamic resolution (on or off)
  • Follows Object Transform
    • position
    • rotation
    • scale
  • Inspector Options
    • remove component
  • Hierarchy Right Click Options
    • copy
    • paste
    • duplicate
    • delete
  • Sprite Renderer
    • can switch sprite
    • can change sprite color with no effect on outline or overlay
    • flip x and flip y
    • draw mode (simple)
  • Extras
    • creating a prefab and making multiple copies of that prefab
    • semi-transparent sprites supported
    • multiple outlines of different types on the same object (for rainbow color outlines)
    • works with animated sprites (by setting the "Animator" "Update Mode" to "Animate Physics”)

Limitations

  • Since I am using the sprite itself to create it's outline, if the sprite is semi transparent, then the outline and the overlay will also be semi transparent
  • "Draw Mode Sliced" Does Not Work if you use a clipping mask (because Unity's Sprite Mask doesn't currently work with its 9 slice system)
  • "Draw Mode Tiled" Does Not Work (because Unity's Sprite Mask doesn't currently work with it)
  • The Standard "Reset" Option Does Not Work (use the built in reset button instead)
  • The "Copy Component" Option Does Not Work and therefore the "Paste Component as New" and "Paste Component Value" Options Dont Work Either

Outline Features (for both convex and concave outlines)

  • Optimization Variables
    • Update Sprite Every Frame [bool]
  • Debugging Variables
    • Show Outline Game Objects in Hierarchy [bool]
  • Sprite Overlay Variables
    • Active [bool]
    • Order in Layer [int]
    • Color [Color]
  • Clipping Mask Variables
    • Active [bool]
    • Alpha Cut Off [float] (only relevant if “Clip Center” == True)
    • Custom Range [bool] (only relevant if “Clip Center” == True)
    • Front Layer [int] (only relevant if “Custom Range” == True)
    • Back Layer [int] (only relevant if “Custom Range” == True)
  • Outline Variables
    • Active [bool]
    • Color [Color]
    • Order in Layer [int]
    • Outline Follows The Sprite's X Scale [bool]
    • Outline Follows The Sprite's Y Scale [bool]

Convex Outline Features

  • Outline Variables
    • Size [float] (local scale)

Concave Outline Features

  • Outline Variables
    • Size [float] (world space)
  • Radial Push Pattern Variables
    • # of edges [int]
    • rotaion [float]

Shader Help Desired

(because I have searched but everything I have found requires too many edits [that I dont know how to make] or doesn't work)
  • creation or location of a shader that can color any sprite a solid color, without copying the alpha like the one I am using does
  • creation of location of a shader with all these specifications. This should make the asset faster and remove many limitations.

Note: If you need parent and child relationships I might be willing to help, email me. It isn't hard, just situation specific.

About

A flexible, option filled, 2D outline solution, that works for both concave and convex sprites and is editable in Play Mode.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published