signal scene_changed(scene_name)
+@onready var background = $Background
+@onready var scroll_container = $ScrollContainer
+
+func _process(_delta):
+ background.material.set_shader_parameter("position", scroll_container.scroll_vertical)
+
func _notification(what):
if what == NOTIFICATION_WM_GO_BACK_REQUEST:
_on_Back_pressed()
func _on_ready():
DEBUG_put_lots_of_tasks(50)
+
shader_parameter/interline_space = 100.0
shader_parameter/right_line_space = 150.0
shader_parameter/start_lines = 250.0
-shader_parameter/position = 0.07
+shader_parameter/position = 0.0
[node name="ToDoList" type="Node"]
script = ExtResource("1_733o8")
uniform float interline_space = 100.0;
uniform float right_line_space = 150.0;
uniform float start_lines = 250.0;
-uniform float position: hint_range(0.0, 1.0, 0.01) = .07;
+uniform float position: hint_range(0.0, 1000, 1) = 0;
void fragment() {
- if(FRAGCOORD.y > start_lines) {
- if(mod(FRAGCOORD.y + start_lines, interline_space) < line_width) {
+ float calc_start = position - start_lines;
+
+ // dont draw at top
+ if (FRAGCOORD.y > calc_start * -1.) {
+ // draw horizontal lines
+ if (mod(FRAGCOORD.y + calc_start, interline_space) < line_width) {
COLOR = line_color;
}
- if(FRAGCOORD.x > line_width) {
- if(mod(FRAGCOORD.x, 1. / SCREEN_PIXEL_SIZE.x - right_line_space) < line_width) {
- COLOR = line_color;
- }
+ // draw the right vertical line
+ float c = 1. / SCREEN_PIXEL_SIZE.x - right_line_space;
+ if (c - line_width < FRAGCOORD.x && FRAGCOORD.x < c) {
+ COLOR = line_color;
}
}