Giter Site home page Giter Site logo

textmesheffects's Introduction

Text Mesh Effects

Header

Text Mesh Effects are simply Mesh effects intended for use with meshes created by Unity's Text component. Unity provides an interface to manipulate the vertex stream of any UI component - this is the same interface used by the built in MeshEffects like Outline and Shadow. Of course, we often want to style text on a per-character basis, which is the root of this set of helpers.

Included Effects

Included Effects

Usage & Creation of TextMeshEffects

BaseTextMeshEffect.cs

This script teakes in the vertex stream and simply handles it 6 vertices at a time, building a new Vertex stream as it goes. It calls ProcessCharacter() with each set of six. Components would derive from BaseTextMeshEffect and override the ProcessCharacter function to perform actions on the verts of each character.

Updating

Some text effects beg to be updated every frame. You should set up a public function you can manually pump, unless you know the text effect will always be updating. I don't think it is wise to call SetVerticesDirty() every frame all the time on everything - but for a lot of games text treatment is important. Take a look at WobblyTextEffect.cs to see how I've chosen to deal with this.

Using Indices

Sometimes you want to know how a single character compares to the entire set of affected characters. You can simply override ModifyMesh in the TextMeshEffect and do your processing before calling the base method. Ensure you call the base function, because BaseTextMeshEffect relies on that call. Take a look at HorizontalGradientTextEffect.cs to see how I handle that.

textmesheffects's People

Contributors

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