forked from team-sg/hero-mark-2
ThE GREAT SHATTERINGgit status! control.tscn is DEAD! LoNG LIVE CONTROL.TSCNgit statusgit status! MWAHAHAHAHAHAHAHA
This commit is contained in:
parent
6c22279e41
commit
c1a9ab7cdc
17 changed files with 253 additions and 270 deletions
29
autoloads/console.gd
Normal file
29
autoloads/console.gd
Normal file
|
@ -0,0 +1,29 @@
|
|||
extends CanvasLayer
|
||||
|
||||
export var opacity: float = 0.5
|
||||
|
||||
var lines: int = 0
|
||||
|
||||
onready var label: Label = $Label
|
||||
|
||||
func _ready() -> void:
|
||||
label.visible = false
|
||||
label.modulate.a = opacity
|
||||
$Label/Panel.modulate.a = opacity
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if Input.is_action_just_pressed("debug_show"):
|
||||
label.visible = not label.visible
|
||||
|
||||
func print(text) -> void:
|
||||
lines += 1
|
||||
if lines > 1:
|
||||
label.text += "\n"
|
||||
if lines > 10:
|
||||
var n = label.text.find("\n")
|
||||
var t = label.text
|
||||
t.erase(0, n+1)
|
||||
lines -= 1
|
||||
label.text = t + str(text)
|
||||
else:
|
||||
label.text += str(text)
|
Loading…
Add table
Add a link
Reference in a new issue