Click or drag to resize
HyperText Class
A UI.Text component which can contain links and apply custom styles.
Inheritance Hierarchy
SystemObject
  Object
    Component
      Behaviour
        MonoBehaviour
          EventSystems.UIBehaviour
            UI.Graphic
              UI.MaskableGraphic
                UI.Text
                  Candlelight.UIHyperText

Namespace: Candlelight.UI
Assembly: Assembly-CSharp-firstpass (in Assembly-CSharp-firstpass.dll) Version: 0.0.0.0
Syntax
C#
public class HyperText : Text, IPointerClickHandler, 
	IEventSystemHandler, IPointerDownHandler, IPointerExitHandler, IPointerUpHandler

The HyperText type exposes the following members.

Properties
  NameDescription
Public propertyalignByGeometry (Inherited from UI.Text.)
Public propertyalignment (Inherited from UI.Text.)
Public propertycachedTextGenerator (Inherited from UI.Text.)
Public propertycachedTextGeneratorForLayout (Inherited from UI.Text.)
Public propertyClickedLink
Occurs when a link on this instance has been clicked (i.e., the pointer button was held down and has just been released over a link).
Public propertyDefaultLinkStyle
Gets the default link style.
Public propertyDefaultQuadMaterial
Gets the default quad material.
Public propertyDefaultTextColor
Gets the default color of the text.
Public propertyDefaultTextStyle
Gets the default style of the text.
Public propertyEnteredLink
Occurs when the pointer has just moved over the hit box for a link on this instance.
Public propertyExitedLink
Occurs when the pointer has just moved off the hit box for a link on this instance.
Public propertyflexibleHeight (Inherited from UI.Text.)
Public propertyflexibleWidth (Inherited from UI.Text.)
Public propertyfont (Inherited from UI.Text.)
Public propertyfontSize (Inherited from UI.Text.)
Public propertyFontSizeToUse
Gets the font size to use.
Public propertyfontStyle (Inherited from UI.Text.)
Public propertyFontToUse
Gets the font to use.
Public propertyhorizontalOverflow (Inherited from UI.Text.)
Public propertyInputTextSource
Gets or sets the input text source. If a value is assigned, its OutputText will be used in place of the value in the UI.Text.text property on this instance.
Public propertyInteractable
Sets a value indicating whether links are interactable on this HyperText.
Public propertyStatic memberIsSilent
Gets or sets a value indicating whether instances of this class should emit debug messages.
Public propertylayoutPriority (Inherited from UI.Text.)
Public propertylineSpacing (Inherited from UI.Text.)
Public propertyLinkHitboxPadding
Gets a value indicating the number of units on each side that link hitboxes should extend beyond the bounds of the glyph geometry. Use positive values to generate link hitboxes that are larger than their encapsulated geometry (for, e.g., small screen devices).
Public propertymainTexture
Gets the main texture.
(Overrides UI.Text.mainTexture.)
Public propertyminHeight (Inherited from UI.Text.)
Public propertyminWidth (Inherited from UI.Text.)
Public propertyOpenURLPatterns
Gets or sets a value indicating whether this instance should automatically open URL patterns (http or https) detected in the name attribute of links when they are clicked.
Public propertypixelsPerUnit
Gets the pixels per unit.
Public propertypreferredHeight
Gets the preferred height for layout.
(Overrides UI.Text.preferredHeight.)
Public propertypreferredWidth
Gets the preferred width for layout.
(Overrides UI.Text.preferredWidth.)
Public propertyPressedLink
Occurs when the pointer button is first pressed down over a link, or when the pointer re-enters the hit box for that link and the pointer button has not yet been released.
Public propertyQuadMaterial
Gets or sets the material to apply to quads.
Public propertyQuadMaterialForRendering
Gets the quad material for rendering.
Public propertyReleasedLink
Occurs when the pointer button is released after first being held down over a link, or when the pointer exits the hit box for that link.
Public propertyresizeTextForBestFit (Inherited from UI.Text.)
Public propertyresizeTextMaxSize (Inherited from UI.Text.)
Public propertyresizeTextMinSize (Inherited from UI.Text.)
Public propertyShouldOverrideLinkHitboxPadding
Gets or sets a value indicating whether this instance should override the link hitbox padding specified in styles if one is assigned.
Public propertyShouldOverrideStylesFontColor
Gets or sets a value indicating whether this HyperText should override the font color specified in styles, if one is assigned.
Public propertyShouldOverrideStylesFontSize
Gets or sets a value indicating whether this HyperText should override the font size specified in styles, if one is assigned.
Public propertyShouldOverrideStylesFontStyle
Gets or sets a value indicating whether this HyperText should override the font face specified in styles, if one is assigned.
Public propertyShouldOverrideStylesLineSpacing
Gets or sets a value indicating whether this instance should override the line spacing specified in styles if one is assigned.
Public propertyStyles
Gets or sets the styles.
Public propertysupportRichText (Inherited from UI.Text.)
Public propertytext (Inherited from UI.Text.)
Public propertyUploadedText
Gets the String uploaded to UI.Text.cachedTextGenerator.
Public propertyverticalOverflow (Inherited from UI.Text.)
Top
Methods
  NameDescription
Public methodCalculateLayoutInputHorizontal (Inherited from UI.Text.)
Public methodCalculateLayoutInputVertical (Inherited from UI.Text.)
Public methodCull
Cull this object's CanvasRenderer if it is outside clipRect.
(Overrides UI.MaskableGraphic.Cull(Rect, Boolean).)
Public methodFontTextureChanged
A callback to indicate the font texture has changed (mirrors that from base class).
Public methodGetGenerationSettings
Gets the generation settings.
Public methodGetLinkHitboxes(DictionaryHyperTextLinkInfo, ListRect)
Gets the link hitboxes.
Public methodGetLinkHitboxes(DictionaryHyperTextLinkInfo, ListRect) Obsolete.
Public methodGetLinkHitboxes(Int32, ListRect)
Gets the link hitboxes for the link with the specified index on this HyperText.
Public methodGetLinkHitboxes(Int32, ListRect) Obsolete.
Public methodGetLinkKeywordCollections(ListHyperTextProcessorKeywordCollectionClass)
Gets the link keyword collections.
Public methodGetLinkKeywordCollections(ListHyperTextProcessorKeywordCollectionClass) Obsolete.
Public methodGetLinks(ListHyperTextLinkInfo)
Gets the info for all of the links current defined on this instance.
Public methodGetLinks(ListHyperTextLinkInfo) Obsolete.
Public methodGetModifiedMaterial
Gets the modified material.
(Overrides UI.MaskableGraphic.GetModifiedMaterial(Material).)
Public methodGetQuadKeywordCollections(ListHyperTextProcessorKeywordCollectionClass)
Gets the quad keyword collections.
Public methodGetQuadKeywordCollections(ListHyperTextProcessorKeywordCollectionClass) Obsolete.
Public methodGetTagKeywordCollections(ListHyperTextProcessorKeywordCollectionClass)
Gets the tag keyword collections.
Public methodGetTagKeywordCollections(ListHyperTextProcessorKeywordCollectionClass) Obsolete.
Public methodOnPointerClick
Raises the pointer click event.
Public methodOnPointerDown
Raises the pointer down event.
Public methodOnPointerExit
Raises the pointer exit event.
Public methodOnPointerUp
Raises the pointer up event.
Public methodOnRebuildRequested
Raises the rebuild requested event.
(Overrides UI.Graphic.OnRebuildRequested().)
Public methodRaycast
A custom raycast callback to determine if the pointer position is over a link, as well as manage some logic related to link states.
(Overrides UI.Graphic.Raycast(Vector2, Camera).)
Public methodSetClipRect
Sets the clipping rectangle on this object's CanvasRenderer.
(Overrides UI.MaskableGraphic.SetClipRect(Rect, Boolean).)
Public methodSetLinkKeywordCollections(IEnumerableHyperTextProcessorKeywordCollectionClass) Obsolete.
Public methodSetLinkKeywordCollections(IListHyperTextProcessorKeywordCollectionClass)
Sets the link keyword collections.
Public methodSetMaterialDirty
Sets the material dirty.
(Overrides UI.Graphic.SetMaterialDirty().)
Public methodSetQuadKeywordCollections(IEnumerableHyperTextProcessorKeywordCollectionClass) Obsolete.
Public methodSetQuadKeywordCollections(IListHyperTextProcessorKeywordCollectionClass)
Sets the quad keyword collections.
Public methodSetTagKeywordCollections(IEnumerableHyperTextProcessorKeywordCollectionClass) Obsolete.
Public methodSetTagKeywordCollections(IListHyperTextProcessorKeywordCollectionClass)
Sets the tag keyword collections.
Public methodSetVerticesDirty
Sets the vertices dirty.
(Overrides UI.Graphic.SetVerticesDirty().)
Top
Extension Methods
  NameDescription
Public Extension MethodGetPrefabName
Gets the name of the prefab associated with the supplied instance.
(Defined by ObjectX.)
Public Extension MethodOpenReferencePage
Opens a reference web page generated for the specified object.
(Defined by ObjectX.)
Top
Remarks

This component internally uses a HyperTextProcessor to support <a> tags and custom styling with user-defined tags and <quad> classes. See HyperTextProcessor for information on syntax, as well as automatic detection and tagging of keywords.

Links extracted by the HyperTextProcessor are then colorized and emit callbacks for different pointer events. For example, the text "Here is a <a name="some_link">link</a>" will render as Here is a link, but with coloration and mouseover events for events for the word link. When the word link is clicked, entered, or exited, the component will emit callbacks of type HyperTextHyperlinkEvent specifying that a link with the id "some_link" was involved, along with its hit boxes.

Note the remarks for each of the events defined for this class. In particular remember that, on touch platforms, a link will be entered after it has been clicked/released, as the virtual pointer is still over the most recently clicked link (see EnteredLink).

When inheriting from this class, note that the implementation of Raycast(Vector2, Camera) only tests against link hit boxes, not the entire RectTransform. As such, event interface methods (e.g., EventSystems.IPointerExitHandler.OnPointerExit(PointerEventData) will only be called as the pointer position relates to the links. If you implement these interfaces in your own class and need them to be with respect to the entire rectangle, you can override Raycast(Vector2, Camera) in the following way:

public override bool Raycast(Vector2 p, Camera c) { return base.Raycast(p, c) || RaycastRect(p, c); }

See Also