Added Glitch Room Source code to Gitty

This commit is contained in:
Jeff Luke committed 2026-10-04 11:31:17 -07:00
commit 1ac9eb5644
505 files changed
+28504

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
@tool
extends Node2D
func _process(_delta: float) -> void:
material.set_shader_parameter("animate_title",get_parent().phase=="title" and not get_parent().reduced_flashes)
material.set_shader_parameter("palette_step",int(get_parent().phase_time*2)%7)
queue_redraw()
func _draw() -> void:
var available := get_viewport_rect().size if not Engine.is_editor_hint() else Vector2(960,720)
var aspect := Vector2(4,3) if get_parent().crt_aspect else Vector2(292,240)
var size := aspect*minf(available.x/aspect.x,available.y/aspect.y)
draw_rect(Rect2(Vector2.ZERO,available),Color.BLACK)
draw_texture_rect($"../PixelScreen".get_texture(),Rect2(((available-size)*.5).floor(),size),false)