Interface ITextComponent
A text component allows displaying text on the screen.
Inherited Members
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 SourceCaretPosition
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
| Improve this Doc View SourceCaretXOffset
Horizontal offset in pixels for the caret.
Declaration
int CaretXOffset { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The caret X offset. |
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. |
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. |
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. |
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. |
OnLabelSizeChanged
Event which fires whenever the label size changes.
Declaration
IBlockingEvent OnLabelSizeChanged { get; }
Property Value
Type | Description |
---|---|
IBlockingEvent | The on label size changed. |
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 |
|
See Also
| Improve this Doc View SourceText
Gets or sets the text.
Declaration
string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String | The text. |
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 |
|
TextBoundingBoxes
Gets the bounding boxes which surround the text..
Declaration
AGSBoundingBoxes TextBoundingBoxes { get; }
Property Value
Type | Description |
---|---|
AGSBoundingBoxes | The text bounding boxes. |
See Also
| Improve this Doc View SourceTextConfig
Gets or sets the text configuration (font, color, outline, etc).
Declaration
ITextConfig TextConfig { get; set; }
Property Value
Type | Description |
---|---|
ITextConfig | The text config. |
TextHeight
Gets the height of the text.
Declaration
float TextHeight { get; }
Property Value
Type | Description |
---|---|
System.Single | The height of the text. |
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. |
TextVisible
Gets or sets a value indicating whether to show/hide the text..
Declaration
bool TextVisible { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
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 SourcePrepareTextBoundingBoxes()
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()