Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


IconBadge

A rectangular badge, usually attached to another visual element.
Read time 7 minutesLast updated 9 days ago

Definition

public class IconBadge : VisualElement, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, ICustomStyle

Constructors

Constructor

Description

IconBadge()Creates a basic comment badge.
IconBadge(UnityEngine.UIElements.VisualTreeAsset)Creates a basic comment badge.

Properties

Property

Description

alignmentRelative alignment between the badge and its target. The alignment will influence icon and tip position.
badgeTextText displayed next to the badge on mouse hover.
distanceDistance between the badge and its target element.
targetTarget element to which this badge is attached.
visualStyleThe visual style for the badge. Built-in values are "error" and "comment".

Methods

Method

Description

AttachToAttaches this badge to another element.
DetachDetaches this badge from its target.
HandleEventBubbleUpExecutes logic on this element during the BubbleUp phase, immediately before this element's BubbleUp callbacks. Calling StopPropagation will prevent further invocations of this method along the propagation path.

Static Methods

Method

Description

CreateCommentCreates an IconBadge with the "comment" visual style.
CreateErrorCreates an IconBadge with the "error" visual style.

Inheritance

Inherited Members