Installation:
- GitHub Repository
- Uncopylocked Roblox Place
- Creator Marketplace (currently unavailable)
Ode Script Editor is a simple and embedded Luau source-code editor in Roblox that can run both in-game and contained in a plugin. It includes some QoL features such as syntax highlighting and auto-indentation.
Here is a very simple snippet that demonstrates its usage. It works almost entirely out of the box with no tinkering required!
local OdeSE = require(path.to.OdeScriptEditor)
local FrameInstance: Frame = path.to.FrameInstance
local scriptEditor = OdeSE.Embed(FrameInstance)
To see it in action, check out my plugin Exestack!
Wait, how do I use this? [DOCUMENTATION]
Ode Script Editor requires minimal setup, only needing a GuiObject (preferably a Frame) and a single function to attach the editor. However, to actually use it for something useful needs some more work. Ode provides a simple API under the ScriptEditor class created by .Embed()
.
ScriptEditor OdeScriptEditor.Embed(Gui: GuiBase2d)
Creates a ScriptEditor class.
nil ScriptEditor:LoadStringAsync(str: string, lineNumber: number?)
Loads a string and jumps to the specified line number or 1 if none is given.
nil ScriptEditor:LoadScriptAsync(scriptObject: LuaSourceContainer, lineNumber: number)
Loads a script and jumps to the specified line number or 1 if none is given. Ode does not save changes if you use this! It needs to be done in conjunction with .OnEdit
.
nil ScriptEditor:Unload()
Unloads the script editor’s source code text.
nil ScriptEditor:ReadOnly(allowEditing: boolean?)
Sets the script editor to read only. If allowEditing
is set to true then it re-enables editing.
nil ScriptEditor:ApplyTheme(odeThemeData: OdeThemeData)
Applies a theme to Ode. Read the source code for more information.
nil ScriptEditor:ApplyStudioTheme(studio: Studio)
Applies a studio theme to Ode.
nil ScriptEditor:Destroy()
Destroys the script editor.
Event ScriptEditor.OnEdit (source: string)
An event that fires whenever an edit has been made.
number ScriptEditor.LineFocused
The line that is first displayed.
string ScriptEditor.RawSource
The raw source code the editor is using.
Frame ScriptEditor.Background
The GUI container for the script editor
boolean ScriptEditor.AutoWrapEnabled
Whether or not auto wrapping is enabled.
number ScriptEditor.VisibleLines
An internal value used to describe the number of lines visible in the editor.
LuaTable ScriptEditor.SourceData
An internal data type used to represent source code.
OdeThemeData ScriptEditor.Theme
An internal table for Ode’s theme data. To change this use the :ApplyTheme
method given. For more information check out the GitHub repo.
Any other features?
I’m quite busy as of right now and can’t find the time to develop much. However, you are welcome to help in the repo!