mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-10 14:05:32 +02:00
WIP: Add readline util
This commit is contained in:
parent
04e07ec9a7
commit
52b7ac2970
6 changed files with 334 additions and 2 deletions
12
examples/readline/readline.gd
Normal file
12
examples/readline/readline.gd
Normal file
|
@ -0,0 +1,12 @@
|
|||
extends "res://addons/godot_xterm/terminal.gd"
|
||||
|
||||
const Readline = preload("res://addons/godot_xterm/util/readline.gd")
|
||||
|
||||
var rl: Readline
|
||||
|
||||
|
||||
func _ready():
|
||||
rl = Readline.new(self)
|
||||
while true:
|
||||
var line: String = yield(rl.readline("Enter something (anything): "), "completed")
|
||||
write("\r\nYou entered: %s\r\n" % line)
|
13
examples/readline/readline.tscn
Normal file
13
examples/readline/readline.tscn
Normal file
|
@ -0,0 +1,13 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://examples/readline/readline.gd" type="Script" id=1]
|
||||
|
||||
[node name="Terminal" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
rect_pivot_offset = Vector2( -194.759, 935.803 )
|
||||
focus_mode = 2
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue