ReGui
  • Introduction
  • Getting Started
    • Installing
    • Creating windows
  • Plugins
    • Custom elements
    • Custom flags
    • Custom themes
  • Examples
    • Demo window
    • Example scripts
  • Methods
  • ReGui functions
  • Canvas functions
  • Configuration saving
  • Elements
    • :Label
    • :Error
    • Code Editor
    • :Button
    • :SmallButton
    • :RadioButton
    • :Image
    • :VideoPlayer
    • :Checkbox
    • :Radiobox
    • :Viewport
    • :Console
    • :Region
    • :List
    • :CollapsingHeader
    • :TreeNode
    • :Separator
    • :Indent
    • :BulletText
    • :Bullet
    • :Row
    • :SliderInt
    • :SliderFloat
    • :SliderEnum
    • :SliderColor3
    • :SliderCFrame
    • :SliderProgress
    • :DragInt
    • :DragFloat
    • :DragColor3
    • :DragCFrame
    • :InputText
    • :InputTextMultiline
    • :InputInt
    • :InputColor3
    • :InputCFrame
    • :ProgressBar
    • :Combo
    • :Keybind
    • :PlotHistogram
    • :Table
    • :TabSelector
    • :Window
    • :TabsWindow
    • :PopupModal
Powered by GitBook
On this page
  • Importing the editor:
  • Example usage:
  1. Elements

Code Editor

type CodeEditor = {
    --// new() arguments
    Editable: boolean?,
    FontSize: number?,
    FontFace: FontFace?,
    
    --// Methods
    ApplyTheme: (self) -> nil,
    GetVersion: () -> string,
    ClearText: (self) -> nil,
    SetText: (self, Text: string) -> nil,
    GetText: (self) -> string,
    SetEditing: (self, Editing: boolean) -> nil,
    AppendText: (self, Text: string) -> nil,
    ResetSelection: (self, NoRefresh: boolean?) -> nil,
    GetSelectionText: (self) -> string,
    
    --// Properties
    Gui: Frame,
    Editing: boolean
}

Importing the editor:

local IDEModule = require(...IDEModule)
local IDEModule = loadstring(game:HttpGet('https://raw.githubusercontent.com/depthso/Dear-ReGui/refs/heads/main/lib/ide.lua'))()

Example usage:

local EditorTab = TabSelector:CreateTab({
	Name = "Editor"
}) --> Canvas

local CodeEditor = IDEModule.CodeFrame.new({
    Editable = false,
    FontSize = 13,
    Colors = SyntaxColors,
    FontFace = TextFont
})

--// Parent and apply custom ReGui properties
ReGui:ApplyFlags({
	Object = CodeEditor.Gui,
	WindowClass = Window,
	Class = {
		--Border = true,
		Fill = true,
		Active = true,
		Parent = EditorTab:GetObject(), -- Canvas function
		BackgroundTransparency = 1,
	}
})
Previous:ErrorNext:Button

Last updated 2 days ago