34 lines
1 KiB
GDScript
34 lines
1 KiB
GDScript
######################
|
|
### Jessist Script ###
|
|
######################
|
|
# This script is part of Jessist
|
|
# Jessist is licensed under GNU GPLv3
|
|
#
|
|
# This script manages the FPS counters
|
|
extends ColorRect
|
|
|
|
export var enableFPSCounter = true
|
|
export var enableXYCounters = true
|
|
export var playerPosition = Vector2(0,0)
|
|
|
|
func _ready():
|
|
gameController.logCall("FPS","_ready",null)
|
|
if enableFPSCounter:
|
|
gameController.logInfo("FPS","_ready","FPS Counter is activated.")
|
|
else:
|
|
gameController.logInfo("FPS","_ready","FPS Counter is deactivated.")
|
|
if enableXYCounters:
|
|
gameController.logInfo("FPS","_ready","XY Counters are activated.")
|
|
else:
|
|
gameController.logInfo("FPS","_ready","XY Counters are deactivated.")
|
|
|
|
func _process(delta):
|
|
gameController.logCall("FPS","_process",delta)
|
|
if enableFPSCounter:
|
|
$FPSCounter.set_text("FPS: " + String(Engine.get_frames_per_second()))
|
|
else:
|
|
$FPSCounter.set_text("")
|
|
if enableXYCounters:
|
|
$XYCounter.set_text("POS: x" + String(playerPosition.x) + " y" + String(playerPosition.y))
|
|
else:
|
|
$XYCounter.set_text("")
|