mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-03 12:04:24 +02:00
parent
f6bd5a11c8
commit
6e938f03bf
41 changed files with 1108 additions and 32 deletions
24
examples/terminal/Terminal.tscn
Normal file
24
examples/terminal/Terminal.tscn
Normal file
|
@ -0,0 +1,24 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://addons/godot_xterm_native/terminal.gdns" type="Script" id=1]
|
||||
[ext_resource path="res://addons/godot_xterm_native/themes/default.theme" type="Theme" id=2]
|
||||
[ext_resource path="res://addons/godot_xterm_native/pseudoterminal.gdns" type="Script" id=3]
|
||||
[ext_resource path="res://examples/terminal/container.gd" type="Script" id=4]
|
||||
|
||||
[node name="Container" type="Container"]
|
||||
script = ExtResource( 4 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Terminal" type="Control" parent="."]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
theme = ExtResource( 2 )
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Pseudoterminal" type="Node" parent="."]
|
||||
script = ExtResource( 3 )
|
18
examples/terminal/container.gd
Normal file
18
examples/terminal/container.gd
Normal file
|
@ -0,0 +1,18 @@
|
|||
extends Container
|
||||
# This Container ensures that the terminal always fills
|
||||
# the window and/or screen. It also connects the terminal
|
||||
# to the input/output of the Psuedoterminal.
|
||||
|
||||
|
||||
onready var viewport = get_viewport()
|
||||
|
||||
func _ready():
|
||||
$Pseudoterminal.connect("data_received", $Terminal, "write")
|
||||
|
||||
viewport.connect("size_changed", self, "_resize")
|
||||
_resize()
|
||||
|
||||
|
||||
func _resize():
|
||||
rect_size = viewport.size
|
||||
$Terminal.rect_size = rect_size
|
Loading…
Add table
Add a link
Reference in a new issue