| HyperText Class |
Namespace: Candlelight.UI
public class HyperText : Text, IPointerClickHandler, IEventSystemHandler, IPointerDownHandler, IPointerExitHandler, IPointerUpHandler
The HyperText type exposes the following members.
| Name | Description | |
|---|---|---|
| alignByGeometry | (Inherited from UI.Text.) | |
| alignment | (Inherited from UI.Text.) | |
| cachedTextGenerator | (Inherited from UI.Text.) | |
| cachedTextGeneratorForLayout | (Inherited from UI.Text.) | |
| ClickedLink |
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).
| |
| DefaultLinkStyle |
Gets the default link style.
| |
| DefaultQuadMaterial |
Gets the default quad material.
| |
| DefaultTextColor |
Gets the default color of the text.
| |
| DefaultTextStyle |
Gets the default style of the text.
| |
| EnteredLink |
Occurs when the pointer has just moved over the hit box for a link on this instance.
| |
| ExitedLink |
Occurs when the pointer has just moved off the hit box for a link on this instance.
| |
| flexibleHeight | (Inherited from UI.Text.) | |
| flexibleWidth | (Inherited from UI.Text.) | |
| font | (Inherited from UI.Text.) | |
| fontSize | (Inherited from UI.Text.) | |
| FontSizeToUse |
Gets the font size to use.
| |
| fontStyle | (Inherited from UI.Text.) | |
| FontToUse |
Gets the font to use.
| |
| horizontalOverflow | (Inherited from UI.Text.) | |
| InputTextSource |
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.
| |
| Interactable |
Sets a value indicating whether links are interactable on this HyperText.
| |
| IsSilent |
Gets or sets a value indicating whether instances of this class should emit debug messages.
| |
| layoutPriority | (Inherited from UI.Text.) | |
| lineSpacing | (Inherited from UI.Text.) | |
| LinkHitboxPadding |
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).
| |
| mainTexture |
Gets the main texture.
(Overrides UI.Text.mainTexture.) | |
| minHeight | (Inherited from UI.Text.) | |
| minWidth | (Inherited from UI.Text.) | |
| OpenURLPatterns |
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.
| |
| pixelsPerUnit |
Gets the pixels per unit.
| |
| preferredHeight |
Gets the preferred height for layout.
(Overrides UI.Text.preferredHeight.) | |
| preferredWidth |
Gets the preferred width for layout.
(Overrides UI.Text.preferredWidth.) | |
| PressedLink |
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.
| |
| QuadMaterial |
Gets or sets the material to apply to quads.
| |
| QuadMaterialForRendering |
Gets the quad material for rendering.
| |
| ReleasedLink |
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.
| |
| resizeTextForBestFit | (Inherited from UI.Text.) | |
| resizeTextMaxSize | (Inherited from UI.Text.) | |
| resizeTextMinSize | (Inherited from UI.Text.) | |
| ShouldOverrideLinkHitboxPadding |
Gets or sets a value indicating whether this instance should override the link hitbox padding specified in
styles if one is assigned.
| |
| ShouldOverrideStylesFontColor |
Gets or sets a value indicating whether this HyperText should override the font
color specified in styles, if one is assigned.
| |
| ShouldOverrideStylesFontSize |
Gets or sets a value indicating whether this HyperText should override the font size specified
in styles, if one is assigned.
| |
| ShouldOverrideStylesFontStyle |
Gets or sets a value indicating whether this HyperText should override the font face specified
in styles, if one is assigned.
| |
| ShouldOverrideStylesLineSpacing |
Gets or sets a value indicating whether this instance should override the line spacing specified in styles
if one is assigned.
| |
| Styles |
Gets or sets the styles.
| |
| supportRichText | (Inherited from UI.Text.) | |
| text | (Inherited from UI.Text.) | |
| UploadedText |
Gets the String uploaded to UI.Text.cachedTextGenerator.
| |
| verticalOverflow | (Inherited from UI.Text.) |
| Name | Description | |
|---|---|---|
| GetPrefabName |
Gets the name of the prefab associated with the supplied instance.
(Defined by ObjectX.) | |
| OpenReferencePage |
Opens a reference web page generated for the specified object.
(Defined by ObjectX.) |
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); }