Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
Game.TextBoxWidget
类 Game.TextBoxWidget 继承关系图:
Game.TextBoxWidget 的协作图:

class  UpdateTask
class  SetCursorPositionTask
class  TextDrawItem
class  NormalDrawItem
class  CompositionTextDrawItem
class  CaretDrawItem
class  SelectionDrawItem
class  EndOfLineDrawItem

Public 成员函数

void ChangeTextNoEvent (string value)
void EnterCharacter (char value, int position=-1, bool moveCaret=true)
void DeleteSelection ()
void EnterText (string value)
void EnterText (string value, int index)
void BackSpace (char? character=null, int count=1, bool moveCaret=true)
void Delete (char? character=null, int count=1)
override void UpdateCeases ()
override void Update ()
void LimitScrollValue ()
 限制 Scroll 属性的值。
 TextBoxWidget ()
override void Overdraw (DrawContext dc)
override void Draw (DrawContext dc)
virtual void Draw_ (DrawContext dc)
override void MeasureOverride (Vector2 parentAvailableSize)
Public 成员函数 继承自 Game.Widget
 Widget ()
virtual void LoadContents (object eventsTarget, XElement node)
virtual void LoadProperties (object eventsTarget, XElement node)
virtual void LoadChildren (object eventsTarget, XElement node)
virtual bool IsChildWidgetOf (ContainerWidget containerWidget)
virtual void ChangeParent (ContainerWidget parentWidget)
virtual void Measure (Vector2 parentAvailableSize)
virtual void Arrange (Vector2 position, Vector2 parentActualSize)
virtual void ArrangeOverride ()
virtual bool HitTest (Vector2 point)
virtual Widget HitTestGlobal (Vector2 point, Func< Widget, bool > predicate=null)
virtual Vector2 ScreenToWidget (Vector2 p)
virtual Vector2 WidgetToScreen (Vector2 p)
virtual void Dispose ()
virtual BoundingRectangle TransformBoundsToParent (Vector2 size)
virtual BoundingRectangle TransformBoundsToGlobal (Vector2 size)

静态 Public 成员函数

static string[] SplitStringAt (string str, int splitPosition)
static void ShowInputMethod ()
static void CloseInputMethod ()
静态 Public 成员函数 继承自 Game.Widget
static Widget LoadWidget (object eventsTarget, XElement node, ContainerWidget parentWidget)
static bool TestOverlap (Widget w1, Widget w2)
static bool IsNodeIncludedOnCurrentPlatform (XElement node)
static void UpdateWidgetsHierarchy (Widget rootWidget)
static void LayoutWidgetsHierarchy (Widget rootWidget, Vector2 availableSize)
static void DrawWidgetsHierarchy (Widget rootWidget)
static Type FindTypeFromXmlName (string name, string namespaceName)
static Widget HitTestGlobal (Widget widget, Vector2 point, Func< Widget, bool > predicate)
static void UpdateWidgetsHierarchy (Widget widget, ref bool isMouseCursorVisible)

Public 属性

bool JustOpened
bool MoveNextFlag
int m_caretPosition
bool m_hasFocus
Vector2m_size
float m_focusStartTime = 0
string m_text = ""
int m_caret
int m_maximumLength = 512
int m_maximumLinesCount = 1
float m_scroll
Vector2 m_sizeValue
Public 属性 继承自 Game.Widget
Action< Vector2MeasureOverride1
Action Update1
bool m_isVisible
bool m_isEnabled
Vector2 m_actualSize
Vector2 m_desiredSize
Vector2 m_parentDesiredSize
BoundingRectangle m_globalBounds
Vector2 m_parentOffset
bool m_isLayoutTransformIdentity = true
bool m_isRenderTransformIdentity = true
Matrix m_layoutTransform = Matrix.Identity
Matrix m_renderTransform = Matrix.Identity
Matrix m_globalTransform = Matrix.Identity
Matrixm_invertedGlobalTransform
float? m_globalScale
Color m_colorTransform = Color.White
Color m_globalColorTransform
WidgetInput m_widgetsHierarchyInput

静态 Public 属性

static string[] CharacterKindsMap = ["abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", "0123456789"]
静态 Public 属性 继承自 Game.Widget
static Queue< DrawContextm_drawContextsCache = new()
static int LayersLimit = -1
static bool DrawWidgetBounds = false

属性

string Description [get, set]
string Title [get, set]
int CaretPosition [get, set]
string SelectionString [get]
string FullText [get]
string Text [get, set]
string CompositionText [get, set]
int CompositionTextCaret [get, set]
int Caret [get, set]
Queue< UpdateTaskTasksQueue = [] [get]
 每帧执行一次的任务队列。
int SelectionLength [get, set]
bool SelectionStarted [get, set]
bool ScrollStarted [get, set]
static TextBoxWidget FocusedTextBox [get, set]
double FocusStartTime [get, set]
bool HasFocus [get, set]
double DragStartTime = -1 [get, set]
Vector2LastDragPosition [get, set]
bool DragStartedInsideTextBox [get, set]
static bool ShowCandidatesWindow = true [get, set]
bool IndentAsSpace = false [get, set]
bool EnterAsNewLine = false [get, set]
int IndentWidth = 4 [get, set]
int MaximumLength [get, set]
int MaximumLinesCount [get, set]
bool PasswordMode [get, set]
bool OverwriteMode [get, set]
bool SwitchTextBoxWhenTabbed = true [get, set]
Color Color = Color.White [get, set]
float Scroll [get, set]
Color OutlineColor = Color.White [get, set]
Color CandidateSelectionColor = Color.Red [get, set]
Color CandidateTextColor = Color.White [get, set]
bool AutoSize = true [get, set]
Vector2 Size [get, set]
Vector2 FontSpacing [get, set]
float FontScale = 1 [get, set]
bool TextureLinearFilter = true [get, set]
Vector2 CandidateListOffset = new(0, 16) [get, set]
float CandidatesSpacing = 4 [get, set]
BitmapFont Font = ContentManager.Get<BitmapFont>("Fonts/Pericles") [get, set]
float CandidateWindowLength = 128 [get, set]
Color CandidateWindowColor = Color.DarkGray [get, set]
static bool InputMethodEnabled [get, set]
static string[] CandidatesList [get]
static int CandidatesSelection [get]
static int CandidatesPageSize [get]
属性 继承自 Game.Widget
WidgetInput WidgetsHierarchyInput [get, set]
WidgetInput Input [get]
Matrix LayoutTransform [get, set]
Matrix RenderTransform [get, set]
Matrix GlobalTransform [get]
float GlobalScale [get]
Matrix InvertedGlobalTransform [get]
BoundingRectangle GlobalBounds [get]
Color ColorTransform [get, set]
Color GlobalColorTransform [get]
virtual string Name [get, set]
object Tag [get, set]
object ExtraData [get, set]
virtual bool IsVisible [get, set]
virtual bool IsEnabled [get, set]
virtual bool IsHitTestVisible [get, set]
bool IsVisibleGlobal [get]
bool IsEnabledGlobal [get]
bool ClampToBounds [get, set]
virtual Vector2 Margin [get, set]
virtual float MarginLeft [get, set]
virtual float MarginRight [get, set]
virtual float MarginTop [get, set]
virtual float MarginBottom [get, set]
virtual Vector4 Margin4 [get, set]
virtual float MarginHorizontalSum [get]
virtual float MarginVerticalSum [get]
virtual Vector2 MarginHorizontalSumAndVerticalSum [get]
virtual WidgetAlignment HorizontalAlignment [get, set]
virtual WidgetAlignment VerticalAlignment [get, set]
Vector2 ActualSize [get]
Vector2 DesiredSize [get, set]
Vector2 ParentDesiredSize [get]
bool IsUpdateEnabled = true [get, set]
bool IsDrawEnabled = true [get, set]
bool IsDrawRequired [get, set]
bool IsOverdrawRequired [get, set]
XElement Style [set]
ContainerWidget ParentWidget [get, set]
Widget RootWidget [get]

事件

Action< TextBoxWidgetFocusLost
Action< TextBoxWidgetOnFocus
Action< TextBoxWidgetEnter
Action< TextBoxWidgetEscape
Action< TextBoxWidgetTextChanged

静态 Private 成员函数

static TextBoxWidget ()
static void SetCursorPosition (TextBoxWidget widget)

详细描述

Survivalcraft Api 所添加的文本框 (支持 Windows IME 输入法, Android IME 适配待开发)。

A text box widget that added by Survivalcraft Api (Support Windows IME, and Android IME support is pending development).

在文件 TextBoxWidget.cs22 行定义.

构造及析构函数说明

◆ TextBoxWidget() [1/2]

Game.TextBoxWidget.TextBoxWidget ( )
staticprivate

在文件 TextBoxWidget.cs666 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ TextBoxWidget() [2/2]

Game.TextBoxWidget.TextBoxWidget ( )

在文件 TextBoxWidget.cs1441 行定义.

成员函数说明

◆ BackSpace()

void Game.TextBoxWidget.BackSpace ( char? character = null,
int count = 1,
bool moveCaret = true )

向左删除字符。

Delete the character on the left of the caret.

参数
character删除的字符,可为 null (为 null 则匹配所有字符)。 Character to delete, can be null (if null then match all characters).
count删除字符的数量 为 -1 则表示删除所有匹配字符 Number of characters to delete, if -1 then delete all matching characters.
moveCaret是否移动光标。 Whether to move the caret.

在文件 TextBoxWidget.cs605 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ ChangeTextNoEvent()

void Game.TextBoxWidget.ChangeTextNoEvent ( string value)

在文件 TextBoxWidget.cs230 行定义.

函数调用图:

◆ CloseInputMethod()

void Game.TextBoxWidget.CloseInputMethod ( )
static

在文件 TextBoxWidget.cs1091 行定义.

这是这个函数的调用关系图:

◆ Delete()

void Game.TextBoxWidget.Delete ( char? character = null,
int count = 1 )

向右删除字符。

Delete character on the right of the caret.

参数
character删除的字符,可为 null (为 null 则匹配所有字符)。 Character to delete, can be null (if null then match all characters).
count删除字符的数量 为 -1 则表示删除所有匹配字符. Number of characters to delete, if -1 then delete all matching characters.

在文件 TextBoxWidget.cs650 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ DeleteSelection()

void Game.TextBoxWidget.DeleteSelection ( )

删除选中的字符。

Delete selected text.

在文件 TextBoxWidget.cs526 行定义.

这是这个函数的调用关系图:

◆ Draw()

override void Game.TextBoxWidget.Draw ( DrawContext dc)
virtual

重载 Game.Widget .

在文件 TextBoxWidget.cs1687 行定义.

函数调用图:

◆ Draw_()

virtual void Game.TextBoxWidget.Draw_ ( DrawContext dc)
virtual

在文件 TextBoxWidget.cs1696 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ EnterCharacter()

void Game.TextBoxWidget.EnterCharacter ( char value,
int position = -1,
bool moveCaret = true )

插入字符。

Enter character.

参数
value插入的字符。 Character to enter.
position插入的位置,默认为 -1 (-1 表示插入到光标位置)。 Position to enter, default is -1 (-1 means insert at caret position)
moveCaret是否移动光标。 Whether to move caret.

在文件 TextBoxWidget.cs453 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ EnterText() [1/2]

void Game.TextBoxWidget.EnterText ( string value)

在光标后插入字符串。

在文件 TextBoxWidget.cs543 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ EnterText() [2/2]

void Game.TextBoxWidget.EnterText ( string value,
int index )

在指定位置插入字符串。

Insert string at specified position.

在文件 TextBoxWidget.cs555 行定义.

函数调用图:

◆ LimitScrollValue()

void Game.TextBoxWidget.LimitScrollValue ( )

限制 Scroll 属性的值。

在文件 TextBoxWidget.cs1271 行定义.

这是这个函数的调用关系图:

◆ MeasureOverride()

override void Game.TextBoxWidget.MeasureOverride ( Vector2 parentAvailableSize)
virtual

重载 Game.Widget .

在文件 TextBoxWidget.cs1817 行定义.

◆ Overdraw()

override void Game.TextBoxWidget.Overdraw ( DrawContext dc)
virtual

重载 Game.Widget .

在文件 TextBoxWidget.cs1600 行定义.

函数调用图:

◆ SetCursorPosition()

void Game.TextBoxWidget.SetCursorPosition ( TextBoxWidget widget)
staticprivate

在文件 TextBoxWidget.cs1450 行定义.

函数调用图:
这是这个函数的调用关系图:

◆ ShowInputMethod()

void Game.TextBoxWidget.ShowInputMethod ( )
static

显示 Windows 系统输入法

在文件 TextBoxWidget.cs1085 行定义.

这是这个函数的调用关系图:

◆ SplitStringAt()

string[] Game.TextBoxWidget.SplitStringAt ( string str,
int splitPosition )
static

TextBoxWidget 内部使用。

For internal use by TextBoxWidget.

参数
str
splitPosition
返回

在文件 TextBoxWidget.cs415 行定义.

这是这个函数的调用关系图:

◆ Update()

override void Game.TextBoxWidget.Update ( )
virtual

重载 Game.Widget .

在文件 TextBoxWidget.cs803 行定义.

函数调用图:

◆ UpdateCeases()

override void Game.TextBoxWidget.UpdateCeases ( )
virtual

重载 Game.Widget .

在文件 TextBoxWidget.cs797 行定义.

函数调用图:

类成员变量说明

◆ CharacterKindsMap

string [] Game.TextBoxWidget.CharacterKindsMap = ["abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", "0123456789"]
static

字符分类表, 用于 Delete 方法 和 BackSpace, 每个元素都存储着某一类字符的所有字符。

Characters table for Delete and BackSpace, Every element stores all character of a character kind.

在文件 TextBoxWidget.cs571 行定义.

◆ JustOpened

bool Game.TextBoxWidget.JustOpened

已弃用。

Deprecated.

在文件 TextBoxWidget.cs36 行定义.

◆ m_caret

int Game.TextBoxWidget.m_caret

在文件 TextBoxWidget.cs279 行定义.

◆ m_caretPosition

int Game.TextBoxWidget.m_caretPosition

旧版文本框的光标位置,现版本不再使用。

Old caret position, now is deprecated.

在文件 TextBoxWidget.cs109 行定义.

◆ m_focusStartTime

float Game.TextBoxWidget.m_focusStartTime = 0

等效于 FocusStartTime, 现版本不再使用,请用 FocusStartTime 替代。

Is the same as FocusStartTime, now is deprecated, use FocusStartTime instead.

在文件 TextBoxWidget.cs158 行定义.

◆ m_hasFocus

bool Game.TextBoxWidget.m_hasFocus

LegacyTextBoxWidget.HasFocus 的后台字段,现版本不再使用,请用 HasFocus 替代。

The backend field of LegacyTextBoxWidget.HasFocus, now is deprecated, use HasFocus instead.

在文件 TextBoxWidget.cs134 行定义.

◆ m_maximumLength

int Game.TextBoxWidget.m_maximumLength = 512

MaximumLength 的后台字段, 不推荐直接使用此值,请使用 MaximumLength

The backend field of MaximumLength, This is not safe to use this field directly, use MaximumLength instead

在文件 TextBoxWidget.cs1168 行定义.

◆ m_maximumLinesCount

int Game.TextBoxWidget.m_maximumLinesCount = 1

在文件 TextBoxWidget.cs1195 行定义.

◆ m_scroll

float Game.TextBoxWidget.m_scroll

在文件 TextBoxWidget.cs1258 行定义.

◆ m_size

Vector2? Game.TextBoxWidget.m_size

LegacyTextBoxWidget.Size 的后台字段,现版本不再使用。

The backend field of old LegacyTextBoxWidget.Size, now is deprecated.

在文件 TextBoxWidget.cs145 行定义.

◆ m_sizeValue

Vector2 Game.TextBoxWidget.m_sizeValue

Size 的后台字段。

The backend field of Size.

在文件 TextBoxWidget.cs1335 行定义.

◆ m_text

string Game.TextBoxWidget.m_text = ""

Text 的后台字段, 不推荐直接使用,请使用 Text

The backend field of Text, it's not safe use it directly, please use Text instead.

在文件 TextBoxWidget.cs206 行定义.

◆ MoveNextFlag

bool Game.TextBoxWidget.MoveNextFlag

在文件 TextBoxWidget.cs39 行定义.

属性说明

◆ AutoSize

bool Game.TextBoxWidget.AutoSize = true
getset

如果为 true 则每帧都会由 MeasureOverride 自动确定 Size 的值。

If true, the size will be set by MeasureOverride every frame.

在文件 TextBoxWidget.cs1325 行定义.

◆ CandidateListOffset

Vector2 Game.TextBoxWidget.CandidateListOffset = new(0, 16)
getset

候选窗位置偏移量, 原点为光标延长线与文本框下边缘的交点。

Position offset of the candidate list, zero means the intersection point of the bottom outline and the extended line of caret.

在文件 TextBoxWidget.cs1393 行定义.

◆ CandidateSelectionColor

Color Game.TextBoxWidget.CandidateSelectionColor = Color.Red
getset

候选窗选中项颜色。

Candidate window selected item color.

在文件 TextBoxWidget.cs1305 行定义.

◆ CandidatesList

string [] Game.TextBoxWidget.CandidatesList
staticget

所有候选词。 请结合 CandidatesSelectionCandidatesPageSize 以获取当前候选词页的候选词。

All candidates. Please get current candidates page's candidates with CandidatesSelection and CandidatesPageSize.

在文件 TextBoxWidget.cs1499 行定义.

◆ CandidatesPageSize

int Game.TextBoxWidget.CandidatesPageSize
staticget

候选窗中当前候选词页大小。

Size of current selected candidates page.

在文件 TextBoxWidget.cs1529 行定义.

◆ CandidatesSelection

int Game.TextBoxWidget.CandidatesSelection
staticget

候选窗中当前选中的词。

Current selected candidate.

在文件 TextBoxWidget.cs1514 行定义.

◆ CandidatesSpacing

float Game.TextBoxWidget.CandidatesSpacing = 4
getset

候选词之间的间距。

Candidates spacing.

在文件 TextBoxWidget.cs1403 行定义.

◆ CandidateTextColor

Color Game.TextBoxWidget.CandidateTextColor = Color.White
getset

候选窗文本颜色。

Candidate window text color.

在文件 TextBoxWidget.cs1315 行定义.

◆ CandidateWindowColor

Color Game.TextBoxWidget.CandidateWindowColor = Color.DarkGray
getset

候选窗背景颜色。

Candidate window background color.

在文件 TextBoxWidget.cs1433 行定义.

◆ CandidateWindowLength

float Game.TextBoxWidget.CandidateWindowLength = 128
getset

候选窗显示的长度。

The length of the candidates window.

在文件 TextBoxWidget.cs1423 行定义.

◆ Caret

int Game.TextBoxWidget.Caret
getset

光标的位置,可被视为 Text 的索引。 绘制时位置为索引对应的字符的左侧,可以与 Text 的长度相等(表示光标在文本末尾)。

Text caret, can be considered as the index of Text. The caret is drawn at the left of the character that corresponds to the index.

在文件 TextBoxWidget.cs291 行定义.

◆ CaretPosition

int Game.TextBoxWidget.CaretPosition
getset

LegacyTextBoxWidget 里的旧版 Caret 属性,现版本不再使用。

Old property of Caret in LegacyTextBoxWidget, now is deprecated.

在文件 TextBoxWidget.cs120 行定义.

◆ Color

Color Game.TextBoxWidget.Color = Color.White
getset

在文件 TextBoxWidget.cs1256 行定义.

◆ CompositionText

string Game.TextBoxWidget.CompositionText
getset

输入法 “组合窗” 的文本, 可能为 null。

仅在 Windows 平台下可用(Android 平台始终为null)。

IME composition text, may be null.

Windows only (Always null on Android).

在文件 TextBoxWidget.cs257 行定义.

◆ CompositionTextCaret

int Game.TextBoxWidget.CompositionTextCaret
getset

“组合窗” 中光标的位置,可被视为 CompositionText 的索引, 等效于 Caret,但是对应的字符串从 Text 变为了 CompositionText, 若需要使用相对于 FullText 的光标(字符索引),请将此值与 Caret 相加。

仅在 Windows 平台下可用(Android 平台始终为 0)。

IME composition text caret position, can be considered as the index of CompositionText, Is the same as Caret, but replaces Text to CompositionText, To get the index to FullText, add this value and Caret.

Windows only.

在文件 TextBoxWidget.cs277 行定义.

◆ Description

string Game.TextBoxWidget.Description
getset

Android 文本框的 Description。

This is the description of android text box.

在文件 TextBoxWidget.cs53 行定义.

◆ DragStartedInsideTextBox

bool Game.TextBoxWidget.DragStartedInsideTextBox
getset

拖拽开始时是否位于文本框内。

Whether the drag started inside the text box.

在文件 TextBoxWidget.cs795 行定义.

◆ DragStartTime

double Game.TextBoxWidget.DragStartTime = -1
getset

Drag 操作开始时 Time.RealTime 的值。

Value of Time.RealTime when drag started.

在文件 TextBoxWidget.cs778 行定义.

◆ EnterAsNewLine

bool Game.TextBoxWidget.EnterAsNewLine = false
getset

是否把回车键视为换行符,而不是视为“输入完毕”的操作。

Considered as new line when typing enter when true, otherwise as “input completed”.

在文件 TextBoxWidget.cs1140 行定义.

◆ FocusedTextBox

TextBoxWidget Game.TextBoxWidget.FocusedTextBox
staticgetset

当前获得焦点的文本框。

The focused text box.

在文件 TextBoxWidget.cs360 行定义.

◆ FocusStartTime

double Game.TextBoxWidget.FocusStartTime
getset

最后一次获取焦点的时间(Time.RealTime), 用于绘制光标(请见Draw方法)。

Last focus time(Time.RealTime), used to draw caret(see Draw method).

在文件 TextBoxWidget.cs372 行定义.

◆ Font

BitmapFont Game.TextBoxWidget.Font = ContentManager.Get<BitmapFont>("Fonts/Pericles")
getset

输入框字体。

Text box font.

在文件 TextBoxWidget.cs1413 行定义.

◆ FontScale

float Game.TextBoxWidget.FontScale = 1
getset

字体缩放。

Font scale.

在文件 TextBoxWidget.cs1371 行定义.

◆ FontSpacing

Vector2 Game.TextBoxWidget.FontSpacing
getset

字体间距。

Font spacing.

在文件 TextBoxWidget.cs1361 行定义.

◆ FullText

string Game.TextBoxWidget.FullText
get

文本框里包括 TextCompositionText 的完整文本。

The full text of this text box, including CompositionText and Text.

在文件 TextBoxWidget.cs194 行定义.

◆ HasFocus

bool Game.TextBoxWidget.HasFocus
getset

当前文本框是否获得焦点。

Whether this text box has focus.

在文件 TextBoxWidget.cs382 行定义.

◆ IndentAsSpace

bool Game.TextBoxWidget.IndentAsSpace = false
getset

是否把输入的制表符替换为空格 (不会影响已经输入过的制表符)。

注意:此属性和 SwitchTextBoxWhenTabbed 冲突,二者不能同时为 true,否则只有一个生效。

Whether replace indent with spaces when typing (doesn't change the already inputted).

NOTICE: This property conflicts with SwitchTextBoxWhenTabbed, they cannot be set to true at the same time, otherwise only one will take effect.

在文件 TextBoxWidget.cs1130 行定义.

◆ IndentWidth

int Game.TextBoxWidget.IndentWidth = 4
getset

IndentAsSpace 为 true 时,输入的制表符会被替换为空格,空格数量由 IndentWidth 决定。

在绘制时,制表符会被视为这个数量的空格。

When IndentAsSpace is true, inputted indents will be replaced with this number of spaces.

When drawing, indents will be considered as this number of spaces.

在文件 TextBoxWidget.cs1156 行定义.

◆ InputMethodEnabled

bool Game.TextBoxWidget.InputMethodEnabled
staticgetset

是否启用输入法。

Whether to enable input method.

在文件 TextBoxWidget.cs1477 行定义.

◆ LastDragPosition

Vector2? Game.TextBoxWidget.LastDragPosition
getset

上一次 Update 方法被执行时 WidgetInput.Drag 的值。

在文件 TextBoxWidget.cs785 行定义.

◆ MaximumLength

int Game.TextBoxWidget.MaximumLength
getset

文本长度限制,设置此属性时会截断超过长度的文本,不可小于 0,若需要设置为无限,请使用 int.MaxValue。

Maximum length of text, the text will be cut when it is longer than this value, the value cannot be less than 0, to set it to infinite, please use int.MaxValue.

在文件 TextBoxWidget.cs1179 行定义.

◆ MaximumLinesCount

int Game.TextBoxWidget.MaximumLinesCount
getset

在文件 TextBoxWidget.cs1197 行定义.

◆ OutlineColor

Color Game.TextBoxWidget.OutlineColor = Color.White
getset

文本框轮廓颜色。

Text box outline color.

在文件 TextBoxWidget.cs1295 行定义.

◆ OverwriteMode

bool Game.TextBoxWidget.OverwriteMode
getset

为 true 时,文本框中输入的字符将覆盖已有文本。

When true, characters inputted will overwrite existing text.

在文件 TextBoxWidget.cs1231 行定义.

◆ PasswordMode

bool Game.TextBoxWidget.PasswordMode
getset

密码模式,开启后所有文本都会被显示为 *(组合窗除外)。

Password mode, all text but composition text ill be drawn as "*".

在文件 TextBoxWidget.cs1221 行定义.

◆ Scroll

float Game.TextBoxWidget.Scroll
getset

在文件 TextBoxWidget.cs1260 行定义.

◆ ScrollStarted

bool Game.TextBoxWidget.ScrollStarted
getset

是否正在滚动。(注意:仅指 Drag 引发的滚动)

Whether the text is scrolling.(NOTICE: Only means drag scroll)

在文件 TextBoxWidget.cs350 行定义.

◆ SelectionLength

int Game.TextBoxWidget.SelectionLength
getset

当前选中的文本长度,为 0 则表示不选择任何文本,可以小于 0.

The length of the selected text, 0 means no text is selected, can be less than 0.

在文件 TextBoxWidget.cs330 行定义.

◆ SelectionStarted

bool Game.TextBoxWidget.SelectionStarted
getset

是否选中文本。

Whether the text is selected.

在文件 TextBoxWidget.cs340 行定义.

◆ SelectionString

string Game.TextBoxWidget.SelectionString
get

选中的字符,当 SelectionLength 为 0 时返回 null。

在文件 TextBoxWidget.cs171 行定义.

◆ ShowCandidatesWindow

bool Game.TextBoxWidget.ShowCandidatesWindow = true
staticgetset

是否显示候选窗。

Whether to show the candidates window.

在文件 TextBoxWidget.cs1111 行定义.

◆ Size

Vector2 Game.TextBoxWidget.Size
getset

输入框大小(不一定是输入框的真实大小,真实大小请见 Widget.ActualSize)。

Text box size (may not be the actual size of the text box, the actual size is Widget.ActualSize)

在文件 TextBoxWidget.cs1345 行定义.

◆ SwitchTextBoxWhenTabbed

bool Game.TextBoxWidget.SwitchTextBoxWhenTabbed = true
getset

当用户按下 Tab 键时,是否切换到下一个文本框

注意:此属性和 SwitchTextBoxWhenTabbed 冲突,二者不能同时为 true,否则只有一个生效。

If true, when the user presses the tab key, the focus will be switched to the next text box.

NOTICE: This property conflicts with SwitchTextBoxWhenTabbed, they cannot be set to true at the same time, otherwise only one will take effect.

在文件 TextBoxWidget.cs1248 行定义.

◆ TasksQueue

Queue<UpdateTask> Game.TextBoxWidget.TasksQueue = []
get

每帧执行一次的任务队列。

在文件 TextBoxWidget.cs320 行定义.

◆ Text

string Game.TextBoxWidget.Text
getset

文本框里已经输入的文本。

Text already inputted of this text box.

在文件 TextBoxWidget.cs216 行定义.

◆ TextureLinearFilter

bool Game.TextBoxWidget.TextureLinearFilter = true
getset

如果为 true,则字体使用线性过滤。

If true, font will use linear texture filtering.

在文件 TextBoxWidget.cs1381 行定义.

◆ Title

string Game.TextBoxWidget.Title
getset

Android 文本框的 Title。

This is the title of android text box.

在文件 TextBoxWidget.cs83 行定义.

事件说明

◆ Enter

Action<TextBoxWidget> Game.TextBoxWidget.Enter

按下回车时触发。

Events will be call when pressing enter.

在文件 TextBoxWidget.cs1571 行定义.

◆ Escape

Action<TextBoxWidget> Game.TextBoxWidget.Escape

按下 Escape 时触发。

Events will be call when pressing escape.

在文件 TextBoxWidget.cs1581 行定义.

◆ FocusLost

Action<TextBoxWidget> Game.TextBoxWidget.FocusLost

输入框失去焦点时触发。

Events will be call when text box loses focus.

在文件 TextBoxWidget.cs1550 行定义.

◆ OnFocus

Action<TextBoxWidget> Game.TextBoxWidget.OnFocus

输入框获得焦点时触发。

Events will be call when text box gets focus.

在文件 TextBoxWidget.cs1560 行定义.

◆ TextChanged

Action<TextBoxWidget> Game.TextBoxWidget.TextChanged

文本改变时触发。

Events will be call when text changed.

在文件 TextBoxWidget.cs1592 行定义.


该类的文档由以下文件生成:
  • E:/sc/doxygen/SurvivalcraftApi 1.8.2.3/Survivalcraft.Windows/Widget/TextBoxWidget.cs