Skip to main content

Home/ abitgames/ Group items tagged sharing

Rss Feed Group items tagged

Nan Wang

Health Bar UI - 0 views

  • Yes, that's the way to do it. For example, this (web player). There are two textures; one for the regular graphics (using normal alpha for nice anti-aliasing) and one for the health bar (using alpha cutoff). The health bar's alpha looks like this: The non-alpha part of the texture is just a block of solid green. The code is this: Code: function Update () { renderer.material.SetFloat("_Cutoff", Mathf.InverseLerp(0, Screen.width, Input.mousePosition.x)); } This is much faster, easier, and less memory-using than having an array of circular textures.
Nan Wang

Ge.tt | Nan Wang - 0 views

shared by Nan Wang on 01 Mar 11 - No Cached
1 - 7 of 7
Showing 20 items per page