s&
About
The Project
info
About s&box
map
Roadmap
monitoring
Metrics
Engine startup and usage numbers
Updates
newspaper
Latest News
published_with_changes
Changes
Release-by-release changelog
Games
Browse Games
Discover Games
gamejams
voting
Game Jam III
Ends
Fri 25 Sep
Theme
One More Round
Voting is open. Play the entries and pick the winner.
£
50,000
prizepool
View the jam
Workshop
Playable
sports_esports
Games
Standalone games and gamemodes
Assets
landscape
Maps
view_in_ar
Models
texture
Materials
apparel
Clothing
apps
Everything
Every asset type in one list
Forum
Learn
Documentation
rocket_launch
Getting Started
docs
Documentation
api
API Reference
Resources
school
Tutorials
manage_search
Code Search
Get s&box
Sign in with Steam
Api
Classes
ScriptControl
chevron_left
Classes
class
ScriptControl
Constructors
functions
ScriptControl
Properties
data_object
Analysis
data_object
CanRedo
data_object
CanUndo
data_object
CaretOffset
data_object
Column
data_object
CompletionVisible
data_object
DiagnosticDelay
data_object
Diagnostics
data_object
Inputs
data_object
Line
data_object
OnDiagnosticsChanged
data_object
OnSourceChanged
data_object
ReadOnly
data_object
ShowStatusBar
data_object
Source
data_object
TabSize
data_object
Theme
Methods
functions
AcceptCompletion
functions
DismissIntelliSense
functions
FocusEditor
functions
GoToDiagnostic
functions
InsertText
functions
OnDeleted
functions
Redo
functions
RefreshAnalysis
functions
Select
functions
ShowCompletions
functions
ShowQuickInfo
functions
Tick
functions
Undo
ScriptControl
A reusable script editor with completion, quick info, parameter help and diagnostics. Analysis uses Game.Scripting and never executes the source. All public source offsets are UTF-16.
class
Sandbox.UI
.
account_tree
extends
Panel
Sandbox.Engine
build
Constructors
1
ScriptControl
(
)
data_object
Properties
17
Analysis
Analysis
The current immutable metadata snapshot, updated immediately when the source or inputs change.
CanRedo
bool
Whether an undone edit is available to redo.
CanUndo
bool
Whether an edit is available to undo.
CaretOffset
int
Caret position measured in UTF-16 source units.
Column
int
One-based text-element column at the caret.
CompletionVisible
bool
Whether the completion list is open.
DiagnosticDelay
float
Seconds of idle time before showing diagnostics. Highlighting stays immediate.
Diagnostics
IReadOnlyList`1
Diagnostics from the current analysis, including those waiting for the display delay.
Inputs
IReadOnlyList`1
Typed external inputs made available to script analysis.
Line
int
One-based line number at the caret.
OnDiagnosticsChanged
Action`1
Called when analysis produces a new diagnostic snapshot, before the display delay.
OnSourceChanged
Action`1
Called immediately when the source text changes, including IME previews.
ReadOnly
bool
Allow selection and navigation while preventing edits.
ShowStatusBar
bool
Show the optional status bar beneath the editor.
Source
string
Source code. Replacing the document clears its undo history.
TabSize
int
Number of spaces inserted for a tab, clamped to one through eight.
Theme
ThemeDefinition
Colors used by this editor. Assigning a new theme updates existing text and popups without changing the document, selection or undo history.
functions
Methods
13
AcceptCompletion
(
)
Replace the current completion range with the selected suggestion as an undoable edit.
DismissIntelliSense
(
)
Close completion, parameter help and hover documentation.
FocusEditor
(
)
Give keyboard focus to the text editor.
GoToDiagnostic
(
previous
)
Move to the next diagnostic (F8), or the previous one (Shift+F8).
InsertText
(
text
)
Insert text at the selection as one undoable edit.
OnDeleted
(
)
Redo
(
)
Reapply the last undone edit and close IntelliSense.
RefreshAnalysis
(
)
Immediately recreate analysis after input metadata or scripting permissions change.
Select
(
start
,
length
)
Select a range of source code, measured in UTF-16 units.
ShowCompletions
(
explicitRequest
)
Open permitted completions for the current caret. Ctrl+Space invokes this.
ShowQuickInfo
(
offset
)
Display symbol documentation or a diagnostic at a UTF-16 source offset.
Tick
(
)
Undo
(
)
Undo the last edit and close IntelliSense.
Inheritance
Panel
ScriptControl
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.