Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

About

Component that draws a Gradient using Unity UI

Topics

Resources

Stars

44 stars

Watchers

2 watching

Forks

Repository files navigation

Gradient Rect

openupm

Unity UI components with color Gradients embedded in their meshes.

Features

  • Uses Unity's built-in Gradient class.
  • Supports additional color tint, 2D textures and sprites.
  • Supports custom materials and masking. Gradient colors are embedded in the generated meshes, the components will never mess with your materials.
  • Supports mesh modifiers, like Outline and Shadow.

How to install

Either:

  • Install using openupm:

    openupm add com.gilzoide.gradient-rect
    
  • Install via Unity Package Manager using the following URL:

    https://github.com/gilzoide/unity-gradient-rect.git#1.2.0
    

Components

Gradient Effect

Gradient Effect adds a gradient to a Unity UI Graphic, including Image and RawImage. Add it via Add Component → UI → Effects → Gradient Effect, then set Gradient and Angle.

  • Angle accepts any angle in degrees. 0° runs left to right, 90° bottom to top, 180° right to left, and 270° top to bottom.
  • On an Image, Preserve Aspect fits the gradient to the sprite, and Fill Amount clips it in place. Use the Image inspector for slicing and tiling.
  • On a Raw Image, the gradient spans the UI rect independently of Texture and UV Rect.
  • The effect multiplies the existing tint and uses the Graphic's material. Multiple effects on the same Graphic apply in component order.
  • In Linear color space, colors are sampled in the same space Unity uses to interpolate UI vertices.
  • If subdivision would exceed uGUI's vertex limit, the effect samples the gradient on the existing vertices.

Legacy components

About

Component that draws a Gradient using Unity UI

Topics

Resources

Stars

44 stars

Watchers

2 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages