Inherits AZ::Component, UiVisualBus::Handler, UiRenderBus::Handler, UiTextBus::Handler, UiClickableTextBus::Handler, UiAnimateEntityBus::Handler, UiTransformChangeNotificationBus::Handler, UiLayoutCellDefaultBus::Handler, FontNotificationBus::Handler, LanguageChangeNotificationBus::Handler, UiCanvasPixelAlignmentNotificationBus::Handler, and TextureAtlasNamespace::TextureAtlasNotificationBus::Handler.
|
| AZ_COMPONENT (UiTextComponent, LyShine::UiTextComponentUuid, AZ::Component) |
|
void | ResetOverrides () override |
|
void | SetOverrideColor (const AZ::Color &color) override |
|
void | SetOverrideAlpha (float alpha) override |
|
void | SetOverrideFont (FontFamilyPtr fontFamily) override |
|
void | SetOverrideFontEffect (unsigned int fontEffectIndex) override |
|
void | Render (LyShine::IRenderGraph *renderGraph) override |
|
AZStd::string | GetText () override |
|
void | SetText (const AZStd::string &text) override |
|
AZStd::string | GetTextWithFlags (GetTextFlags flags=GetAsIs) override |
|
void | SetTextWithFlags (const AZStd::string &text, SetTextFlags flags=SetAsIs) override |
|
AZ::Color | GetColor () override |
|
void | SetColor (const AZ::Color &color) override |
|
LyShine::PathnameType | GetFont () override |
|
void | SetFont (const LyShine::PathnameType &fontPath) override |
|
int | GetFontEffect () override |
|
void | SetFontEffect (int effectIndex) override |
|
AZStd::string | GetFontEffectName (int effectIndex) override |
|
void | SetFontEffectByName (const AZStd::string &effectName) override |
|
float | GetFontSize () override |
|
void | SetFontSize (float size) override |
|
void | GetTextAlignment (IDraw2d::HAlign &horizontalAlignment, IDraw2d::VAlign &verticalAlignment) override |
|
void | SetTextAlignment (IDraw2d::HAlign horizontalAlignment, IDraw2d::VAlign verticalAlignment) override |
|
IDraw2d::HAlign | GetHorizontalTextAlignment () override |
|
void | SetHorizontalTextAlignment (IDraw2d::HAlign alignment) override |
|
IDraw2d::VAlign | GetVerticalTextAlignment () override |
|
void | SetVerticalTextAlignment (IDraw2d::VAlign alignment) override |
|
float | GetCharacterSpacing () override |
|
void | SetCharacterSpacing (float characterSpacing) override |
|
float | GetLineSpacing () override |
|
void | SetLineSpacing (float lineSpacing) override |
| Expects pixels.
|
|
int | GetCharIndexFromPoint (AZ::Vector2 point, bool mustBeInBoundingBox) override |
|
int | GetCharIndexFromCanvasSpacePoint (AZ::Vector2 point, bool mustBeInBoundingBox) override |
|
AZ::Vector2 | GetPointFromCharIndex (int index) override |
|
AZ::Color | GetSelectionColor () override |
|
void | GetSelectionRange (int &startIndex, int &endIndex) override |
|
void | SetSelectionRange (int startIndex, int endIndex, const AZ::Color &selectionColor) override |
|
void | ClearSelectionRange () override |
|
AZ::Vector2 | GetTextSize () override |
|
float | GetTextWidth () override |
|
float | GetTextHeight () override |
|
void | GetTextBoundingBox (int startIndex, int endIndex, UiTransformInterface::RectPointsArray &rectPoints) override |
|
DisplayedTextFunction | GetDisplayedTextFunction () const override |
|
void | SetDisplayedTextFunction (const DisplayedTextFunction &displayedTextFunction) override |
|
OverflowMode | GetOverflowMode () override |
|
void | SetOverflowMode (OverflowMode overflowMode) override |
|
WrapTextSetting | GetWrapText () override |
|
void | SetWrapText (WrapTextSetting wrapSetting) override |
|
ShrinkToFit | GetShrinkToFit () override |
|
void | SetShrinkToFit (ShrinkToFit shrinkToFit) override |
|
void | ResetCursorLineHint () override |
|
bool | GetIsMarkupEnabled () override |
|
void | SetIsMarkupEnabled (bool isEnabled) override |
|
float | GetMinimumShrinkScale () override |
|
void | SetMinimumShrinkScale (float minShrinkScale) override |
|
void | GetClickableTextRects (UiClickableTextInterface::ClickableTextRects &clickableTextRects) override |
|
void | SetClickableTextColor (int id, const AZ::Color &color) override |
|
void | PropertyValuesChanged () override |
|
void | OnCanvasSpaceRectChanged (AZ::EntityId entityId, const UiTransformInterface::Rect &oldRect, const UiTransformInterface::Rect &newRect) override |
|
void | OnTransformToViewportChanged () override |
|
float | GetMinWidth () override |
|
float | GetMinHeight () override |
|
float | GetTargetWidth (float maxWidth) override |
|
float | GetTargetHeight (float maxHeight) override |
|
float | GetExtraWidthRatio () override |
|
float | GetExtraHeightRatio () override |
|
void | OnFontsReloaded () override |
|
void | LanguageChanged () override |
|
void | OnCanvasTextPixelAlignmentChange () override |
|
void | OnAtlasLoaded (const TextureAtlasNamespace::TextureAtlas *atlas) override |
|
void | OnAtlasUnloaded (const TextureAtlasNamespace::TextureAtlas *atlas) override |
|
|
void | Init () override |
|
void | Activate () override |
|
void | Deactivate () override |
|
void | ChangeFont (const AZStd::string &fontFileName) |
| Called when we know the font needs to be changed.
|
|
void | GetTextBoundingBoxPrivate (const DrawBatchLines &drawBatchLines, int startIndex, int endIndex, UiTransformInterface::RectPointsArray &rectPoints) |
| Implementation of getting bounding box for the given displayed text.
|
|
void | GetTextRect (UiTransformInterface::RectPoints &rect) |
| Get the bounding rectangle of the text, in untransformed canvas space.
|
|
void | GetTextRect (UiTransformInterface::RectPoints &rect, const AZ::Vector2 &textSize) |
|
void | OnTextChange () |
| ChangeNotify callback for text string change.
|
|
void | OnColorChange () |
| ChangeNotify callback for color change.
|
|
void | OnAlignmentChange () |
| ChangeNotify callback for alignment change.
|
|
void | OnOverflowChange () |
| ChangeNotify callback for overflow settings change.
|
|
void | OnFontSizeChange () |
| ChangeNotify callback for font size change.
|
|
AZ::u32 | OnFontPathnameChange () |
| ChangeNotify callback for font pathname change.
|
|
void | OnFontEffectChange () |
| ChangeNotify callback for font effect change.
|
|
void | OnWrapTextSettingChange () |
| ChangeNotify callback for text wrap setting change.
|
|
void | OnShrinkToFitChange () |
| ChangeNotify callback for shrink-to-fit setting change.
|
|
void | OnMinShrinkScaleChange () |
| ChangeNotify callback for "minimum shrink scale" setting change.
|
|
void | OnCharSpacingChange () |
| ChangeNotify callback for char spacing change.
|
|
void | OnLineSpacingChange () |
| ChangeNotify callback for line spacing change.
|
|
void | OnMarkupEnabledChange () |
| ChangeNotify callback for markup enabled change.
|
|
FontEffectComboBoxVec | PopulateFontEffectList () |
| Populate the list for the font effect combo box in the properties pane.
|
|
float | CalculateHorizontalClipOffset () |
|
void | MarkDrawBatchLinesDirty (bool invalidateLayout) |
| Mark draw batches dirty.
|
|
const DrawBatchLines & | GetDrawBatchLines () |
| Calculate the DrawBatchLines if needed and return a const ref.
|
|
void | CalculateDrawBatchLines (UiTextComponent::DrawBatchLines &drawBatchLinesOut, bool forceNoWrap=false, float availableWidth=-1.0f, bool excludeTrailingSpaceWidth=true) |
| Calculates draw batch lines.
|
|
void | RenderToCache (float alpha) |
| Renders the text to the render cache.
|
|
void | RenderDrawBatchLines (const UiTextComponent::DrawBatchLines &drawBatchLines, const AZ::Vector2 &pos, const UiTransformInterface::RectPoints &points, const AZ::Matrix4x4 &transformToViewport, STextDrawContext &fontContext) |
| Add DrawBatch lines to the render graph for rendering.
|
|
void | UpdateTextRenderBatchesForFontTextureChange () |
| Update the text render batches in the case of a font texture change.
|
|
STextDrawContext | GetTextDrawContextPrototype (int requestFontSize, const AZ::Vector2 &fontSizeScale) const |
| Returns a prototypical STextDrawContext to be used when interacting with IFont routines..
|
|
void | OnTextWidthPropertyChanged () |
| Recomputes draw batch lines as appropriate depending on current options when text width properties are modified.
|
|
void | HandleOverflowText (UiTextComponent::DrawBatchLines &drawBatchLinesOut) |
| Handles overflow and shrink-to-text settings to text.
|
|
void | HandleShrinkToFit (UiTextComponent::DrawBatchLines &drawBatchLinesOut, float availableHeight=-1.0f) |
| Handles shrink-to-fit for text, if applicable.
|
|
void | HandleUniformShrinkToFitWithScale (UiTextComponent::DrawBatchLines &drawBatchLinesOut, const AZ::Vector2 &scaleVec) |
| Handles the "uniform" shrink-to-fit setting.
|
|
void | HandleShrinkToFitWithWrapping (UiTextComponent::DrawBatchLines &drawBatchLinesOut, const AZ::Vector2 ¤tElementSize, const AZ::Vector2 &textSize) |
| Handles the shrink-to-fit setting for word-wrapped text.
|
|
void | HandleWidthOnlyShrinkToFitWithWrapping (UiTextComponent::DrawBatchLines &drawBatchLinesOut, const AZ::Vector2 ¤tElementSize, int maxLinesElementCanHold) |
| Handles "width only" word-wrapped shrink-to-fit text.
|
|
void | HandleUniformShrinkToFitWithWrapping (UiTextComponent::DrawBatchLines &drawBatchLinesOut, const AZ::Vector2 ¤tElementSize, int maxLinesElementCanHold) |
| Handles "uniform" word-wrapped shrink-to-fit text.
|
|
void | HandleEllipsis (UiTextComponent::DrawBatchLines &drawBatchLinesOut, float availableHeight=-1.0f) |
| Inserts ellipsis into overflowing text.
|
|
void | GetLineToEllipsisAndLinesToTruncate (UiTextComponent::DrawBatchLines &drawBatchLinesOut, DrawBatchLineContainer::iterator *lineToEllipsis, DrawBatchLineIters &linesToRemove, const AZ::Vector2 ¤tElementSize) |
| Returns the draw batch line to ellipsis and the following lines to truncate (if any).
|
|
void | GetDrawBatchStartPositions (DrawBatchStartPositions &startPositions, DrawBatchLine *lineToEllipsis, const AZ::Vector2 ¤tElementSize) |
| Returns the "starting" pixel position for each batch on the given line.
|
|
DrawBatch * | GetDrawBatchToEllipseAndPositions (const char *ellipseText, const STextDrawContext &ctx, const AZ::Vector2 ¤tElementSize, DrawBatchStartPositions *startPositions, float *drawBatchStartPos, float *ellipsisPos) |
| Returns the draw batch that will have ellipsis inserted, along with required position information to do so.
|
|
void | TruncateDrawBatches (DrawBatchLine *lineToTruncate, const DrawBatch *truncateAfterBatch) |
| Removes all draw batches following the given DrawBatch on the given DrawBatchLine.
|
|
int | GetStartEllipseIndexInDrawBatch (const DrawBatch *drawBatchToEllipse, const STextDrawContext &ctx, const float drawBatchStartPos, const float ellipsePos) |
| Given a draw batch, get the character index where ellipsis should be inserted in the string.
|
|
void | InsertEllipsisText (const char *ellipseText, const int ellipsisCharPos, DrawBatch *drawBatchToEllipse) |
| Inserts the ellipse text into the given draw batch and updates batch and line sizing information.
|
|
void | SetBatchLineFontPointers (DrawBatchLine *batchLine) |
|
bool | GetTextOverflowsBounds (const AZ::Vector2 &textSize, const AZ::Vector2 &elementSize) const |
| Returns true if the given text rect overflows the given element size, false otherwise.
|
|
AZ::Vector2 | GetTextSizeFromDrawBatchLines (const UiTextComponent::DrawBatchLines &drawBatchLines) const |
| Compute the text size from the already computed draw batch lines.
|
|
AZStd::string | GetLocalizedText (const AZStd::string &text) |
| Localize the given text string.
|
|
AZ::Vector2 | CalculateAlignedPositionWithYOffset (const UiTransformInterface::RectPoints &points) |
|