Add click overlay

This commit is contained in:
JeremyStar™ 2024-05-17 02:09:08 +02:00
parent 7d01a8fd13
commit 65a7f5ca8e
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -24,6 +24,7 @@ var sms: CoreBaseModule
# Presencode infrastructure # Presencode infrastructure
var presenloader: Node var presenloader: Node
var clickoverlay: Button = Button.new()
# Presentation data # Presentation data
var entrypoint: PresencodeEntrypoint var entrypoint: PresencodeEntrypoint
@ -31,16 +32,29 @@ var manifest: Dictionary
var current_slide: int = 0 var current_slide: int = 0
var slide_switch_in_progress: bool = false var slide_switch_in_progress: bool = false
# +++ initialization +++ # +++ initialization and processing +++
func _init(core_new: Core, presenloader_new: Node) -> void: func _init(core_new: Core, presenloader_new: Node) -> void:
name = "Communication"
core = core_new core = core_new
logger = core.logger.get_instance("src/classes/communication.gd", self) logger = core.logger.get_instance("src/classes/communication.gd", self)
sms = core.sms sms = core.sms
presenloader = presenloader_new presenloader = presenloader_new
clickoverlay.name = "Click Overlay"
clickoverlay.size = Vector2(100000.0, 100000.0)
clickoverlay.position = -Vector2(50000.5, 50000.5)
clickoverlay.modulate = Color(1, 1, 1, 0)
clickoverlay.connect("pressed", func() -> void:
logger.diag("Navigating to next slide")
switch_slide(current_slide + 1)
)
func _ready() -> void:
# Add click overlay to 'debug' scene collection
sms.add_scene("clickoverlay", clickoverlay, CoreTypes.SceneType.DEBUG)
func _process(_delta: float) -> void: func _process(_delta: float) -> void:
# Check for inputs # Check for inputs
if Input.is_action_just_pressed("fullscreen"): if Input.is_action_just_pressed("fullscreen"):
logger.diag("Toggling fullscreen mode") logger.diag("Toggling fullscreen mode")