CanvasElementBeveledRect Class

Definition

Procedurally generates a 3D rounded rect mesh to be rendered within a UnityUI canvas.

[UnityEngine.RequireComponent(typeof(UnityEngine.CanvasRenderer))]
public class CanvasElementBeveledRect : UnityEngine.UI.MaskableGraphic
[<UnityEngine.RequireComponent(typeof(UnityEngine.CanvasRenderer))>]
type CanvasElementBeveledRect = class
    inherit MaskableGraphic
Public Class CanvasElementBeveledRect
Inherits MaskableGraphic
Inheritance
UnityEngine.UI.MaskableGraphic
CanvasElementBeveledRect
Attributes
UnityEngine.RequireComponentAttribute

Constructors

CanvasElementBeveledRect()

Properties

BackBevelRadius

Specifies the back bevel radius in world units. Should be less than the radius

BackBevelSections

Specifies the back bevel radius in world units. Should be less than half the radius

FrontBevelRadius

Specifies the front bevel radius in world units. Should be less than the radius

FrontBevelSections

Specifies the front bevel radius in world units. Should be less than half the radius

Radius

Specifies the corner radius in world units. Should be less than half the width or height.

Thickness

Controls the depth of the rounded rect along the local z axis.

Wedges

Controls how many subdivisions at the corners of the rounded rect. More wedges produces smoother corners at the expense of more triangles.

Methods

OnPopulateMesh(VertexHelper)

When the mesh changes, rebuilds the vertices.

OnRectTransformDimensionsChange()

Marks the vertices dirty when the rect changes.

OnTransformParentChanged()

Marks the vertices dirty when the parent changes.

Start()

Ensures the canvas generates required vertex attributes.

Applies to