Source Editor
Source Editor is Studio's text editor for scripts, shaders, data files and any other text file. It also shows the text behind the visual editors, so a change made in Scene View or the Effect Editor appears here too, with the same Undo history. Saving, conflicts, autosave and recovery are described in Documents.
Layout
- Tabs: one per open document. A dot marks unsaved changes; read-only files are marked · Engine or · External. When tabs overflow, scroll them with the mouse wheel or the arrow button.
- Header: the file path,
Ln,Coland Saved, Unsaved or Read only. - Text area: line numbers, text and a scrollbar.
Press Ctrl+Tab to switch between recent documents: keep Ctrl held, press Tab to move down the list, and release Ctrl to switch. Esc cancels.
Editing
Click in the text to start typing.
| Key | Action |
|---|---|
| Arrows, Home / End, PgUp / PgDn | Move the cursor. |
| Ctrl+Left / Ctrl+Right | Move by word. |
| Ctrl+Home / Ctrl+End | Go to the start / end of the file. |
| Shift + movement | Select. |
| Shift+Alt + movement | Select a rectangle (column selection). |
| Tab | Inserts four spaces. |
| Backspace / Delete | Delete a character or the selection. |
| Ctrl+Backspace / Ctrl+Delete | Delete a word. |
| Esc | Clears the selection, then leaves the editor. |
| Mouse | Action |
|---|---|
| Click, drag, Shift+click | Place the cursor, select, extend the selection. |
| Double-click | Select a word (keep dragging to select more words). |
| Alt+click, Alt+drag | Rectangle selection. Typing, pasting and deleting apply to every row. |
Click a line number (.bt files) | Toggle a breakpoint. |
| Right-click | Code menu: Inspect Symbol, Complete, Go to Definition, Find Usages; see Code intelligence. |
Undo (Ctrl+Z), Redo (Ctrl+Y), Cut, Copy, Paste, Select All, Save (Ctrl+S) and Toggle Breakpoint (F9) are Studio commands; see Commands and shortcuts.
Find
| Key | Action |
|---|---|
| Ctrl+F | Opens Find. Selected text becomes the search. |
| Type | Searches as you type. |
| Enter / Shift+Enter, F3 / Shift+F3 | Next / previous match. F3 works with Find closed. |
| Esc | Closes Find. |
Search is case-sensitive, matches literal text on one line, and wraps around
the file. The box shows N of M or "No results".
Highlighting
| Files | Highlighting |
|---|---|
.bt | BT |
.glsl, .vert, .frag, .comp, .geom, .tesc, .tese, .shader, .vs, .fs, .vsh, .fsh | GLSL |
.hlsl, .hlsli | HLSL |
.wgsl | WGSL |
.metal | Metal |
.json, .ctproject | JSON |
.yaml, .yml, .motion, .rig | YAML |
Shader files show a Shader Editor header with the language. Saving a shader only saves the file; rebuild the game to see the change.
Read-only files
Engine library and dependency sources (· Engine) and files outside your project opened from the debugger or code navigation (· External) are read-only. You can select, copy and search them.
Limits
- Not implemented: find and replace; regex, whole-word or case-insensitive search; auto-indent; indenting a selection (Tab replaces it); triple-click; word wrap; IME input.