class
GUIInputSelection
Helper class for dealing with text selection for text input boxes and similar controls.
Public
Constructors
GUIInputSelection
Methods
~GUIInputSelection
GetSprites
Returns sprites representing the currently selected areas.
GetBounds
Returns the bounds of the particular selection sprite, relative to the current parent GUI element.
UpdateSprite
Recreates the selection clip sprites.
ShowSelection
Shows the selection using the specified anchor.
By default this will select 0 characters so you must manually move the selection using MoveSelectionToCaret() before anything is considered selected.
- anchorCaretPos
- Anchor position which to initially select. Anchor position determines selection area behavior when the input caret moves (determines whether left or right side of the selection will move with the caret).
ClearSelectionVisuals
Clears the currently active selection.
Note this does not clear the internal selection range, just the selection sprites.
MoveSelectionToCaret
Moves the selection to caret.
Selected area will be from the anchor provided in ShowSelection() to the caret position provided here.
IsSelectionEmpty
Checks is anything selected.
SelectAll
Selects all available text.
SelectionDragStart
Starts selection drag at the specified caret position.
Call SelectionDragUpdate() and SelectionDragEnd() as the drag operation progresses.
SelectionDragUpdate
Updates selection drag at the specified caret position.
SelectionDragEnd
Stops selection drag.
GetSelectionStart
Gets caret index of selection start.
GetSelectionEnd
Gets caret index of selection end.
Private
Methods
GetSelectionRects
Returns rectangles describing the currently selected areas.
Rectangles are relative to parent GUI element.