Show / Hide Table of Contents

    Interface ITextComponent

    A text component allows displaying text on the screen.

    Inherited Members
    IComponent.Name
    IComponent.Entity
    IComponent.RegistrationType
    IComponent.Init(IEntity, Type)
    IComponent.AfterInit()
    System.IDisposable.Dispose()
    System.ComponentModel.INotifyPropertyChanged.PropertyChanged
    Namespace: AGS.API
    Assembly: AGS.API.dll
    Syntax
    [RequiredComponent(typeof(IImageComponent), true)]
    [RequiredComponent(typeof(IDrawableInfoComponent), true)]
    [RequiredComponent(typeof(ICropSelfComponent), false)]
    [RequiredComponent(typeof(IModelMatrixComponent), true)]
    [RequiredComponent(typeof(IVisibleComponent), true)]
    public interface ITextComponent : IComponent, IDisposable, INotifyPropertyChanged

    Properties

    | Improve this Doc View Source

    CaretPosition

    The position of the caret inside the string (if the caret is displayed- i.e if it's a textbox). A value of 3, for example, means the caret will be shown after the 3rd character. The default is 0, meaning the caret will be placed at the start of the string. The caret position automatically changes based on the keyboard input.

    Declaration
    int CaretPosition { get; set; }
    Property Value
    Type Description
    System.Int32
    See Also
    RenderCaret
    | Improve this Doc View Source

    CaretXOffset

    Horizontal offset in pixels for the caret.

    Declaration
    int CaretXOffset { get; set; }
    Property Value
    Type Description
    System.Int32

    The caret X offset.

    | Improve this Doc View Source

    CustomImageResolutionFactor

    The text component can supply a custom resolution factor (due to text scaling) to override the resolution factor used by calculations in IModelMatrixComponent.

    Declaration
    PointF? CustomImageResolutionFactor { get; }
    Property Value
    Type Description
    System.Nullable<PointF>

    The custom image resolution factor.

    | Improve this Doc View Source

    CustomImageSize

    The text component can supply a custom image size to override the image size used by calculations in IModelMatrixComponent.

    Declaration
    SizeF? CustomImageSize { get; }
    Property Value
    Type Description
    System.Nullable<SizeF>

    The custom size.

    | Improve this Doc View Source

    CustomTextCrop

    Allows to set a custom cropper for the text (used by ICropChildrenComponent) to crop the text of the child.

    Declaration
    ICropSelfComponent CustomTextCrop { get; set; }
    Property Value
    Type Description
    ICropSelfComponent

    The custom text crop.

    | Improve this Doc View Source

    LabelRenderSize

    Gets or sets the size of the label that hosts the text (that label can have a color and a border, and is also used for text alignment calculations).

    Declaration
    SizeF LabelRenderSize { get; set; }
    Property Value
    Type Description
    SizeF

    The size of the label render.

    | Improve this Doc View Source

    OnLabelSizeChanged

    Event which fires whenever the label size changes.

    Declaration
    IBlockingEvent OnLabelSizeChanged { get; }
    Property Value
    Type Description
    IBlockingEvent

    The on label size changed.

    | Improve this Doc View Source

    RenderCaret

    Gets or sets a value indicating whether this ITextComponent should render a caret (a vertical line, used for displaying text boxes).

    Declaration
    bool RenderCaret { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if render caret; otherwise, false.

    See Also
    CaretPosition
    | Improve this Doc View Source

    Text

    Gets or sets the text.

    Declaration
    string Text { get; set; }
    Property Value
    Type Description
    System.String

    The text.

    | Improve this Doc View Source

    TextBackgroundVisible

    Gets or sets a value indicating whether the background of the text should be rendered.

    Declaration
    bool TextBackgroundVisible { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if label visible; otherwise, false.

    | Improve this Doc View Source

    TextBoundingBoxes

    Gets the bounding boxes which surround the text..

    Declaration
    AGSBoundingBoxes TextBoundingBoxes { get; }
    Property Value
    Type Description
    AGSBoundingBoxes

    The text bounding boxes.

    See Also
    PrepareTextBoundingBoxes()
    | Improve this Doc View Source

    TextConfig

    Gets or sets the text configuration (font, color, outline, etc).

    Declaration
    ITextConfig TextConfig { get; set; }
    Property Value
    Type Description
    ITextConfig

    The text config.

    | Improve this Doc View Source

    TextHeight

    Gets the height of the text.

    Declaration
    float TextHeight { get; }
    Property Value
    Type Description
    System.Single

    The height of the text.

    | Improve this Doc View Source

    TextLockStep

    Allows locking the component from changing (to allow for changing multiple components "at once").

    Declaration
    ILockStep TextLockStep { get; }
    Property Value
    Type Description
    ILockStep

    The lock step.

    | Improve this Doc View Source

    TextVisible

    Gets or sets a value indicating whether to show/hide the text..

    Declaration
    bool TextVisible { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if text visible; otherwise, false.

    | Improve this Doc View Source

    TextWidth

    Gets the width of the text.

    Declaration
    float TextWidth { get; }
    Property Value
    Type Description
    System.Single

    The width of the text.

    Methods

    | Improve this Doc View Source

    PrepareTextBoundingBoxes()

    Prepares the bounding boxes for the text. This is called repeatedly by the engine, but you can call it yourself if you need accurate measurements NOW.

    Declaration
    void PrepareTextBoundingBoxes()
    See Also
    TextBoundingBoxes
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX