Code Monkey home page Code Monkey logo

unity-vertex-effects's Introduction

Beautiful Text Outline for Unity UI

Unity UIのTextに綺麗な輪郭線を付ける

This repository contains improved versions of the Outline effect. They can render thick text outline beautifully. They can be also used as soft (blurred) shadow effects.

Keywords

Unity uGUI Text Outline Shadow 文字 縁取り 輪郭 影

Comparison

CAUTION: Parenthesized numbers are rendering costs relative to text without outline. Take care where to use! Outline

Outline

The builtin outline effect. It cannot render thick outlines correctly. It renders colored text meshes at 4 slightly shfted positions (up-left, up-right, down-left and down-right) from the main text mesh.

Outline8

A slightly improved version of Outline. It renders text meshes at 8 positions (up, down, left, right, up-left, up-right, and so on). It is equivalent to BoxOutline of (X,Y)=(1,1).

BoxOutline

Generalized version of Outline8. It renders text meshes at (2X+1)*(2Y+1)-1 positions on a grid whose center is same as the main text mesh.

CircleOutline

This can express outline thickness correctly. It renders text meshes at (N+K)+(N+2K)+... positions. Each N+iK positions are on a circle whose radius is i and center is same as the main text mesh.

Drop shadow

When the alpha of the outline color is small, the outlines look like soft shadow: DropShadow

Performance

Not good, as you can imagine. I recommend the following assets and techniques.

Unity versions

The APIs for modifying UI meshes are different among versions:

  • 5.5-5.1: IVertexModifier.ModifyVertices(List)
  • 5.2-5.2.1: IMeshModifier.ModifyMesh(Mesh)
  • 5.2.1p1-: IMeshModifier.ModifyMesh(VertexHelper)

In this project, ModifiedShadow absorbs these differences. When you use our scripts in Unity 5.2.1pX, please define UNITY_5_2_1pX at Scripting Define Symbols in Player Settings.

unity-vertex-effects's People

Contributors

n-yoda avatar progm avatar fniwes avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.