Fixed auto scrolling to inspiration. Fixed show answer changes song list. Started working on some colors

This commit is contained in:
2023-09-02 14:05:41 +02:00
parent 3fabf45985
commit 1045bf2f9e
6 changed files with 99 additions and 28 deletions

View File

@@ -0,0 +1,36 @@
extends ScrollContainer
var SCROLL = 0
var delay = 0.02 #seconds
var wait = 0
var SPEED: int = 1
# Called when the node enters the scene tree for the first time.
func _ready():
wait = delay
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
wait -= delta
if wait < 0:
wait = delay
#SCROLL DOWN
if SCROLL == 1:
if (scroll_vertical + get_v_scroll_bar().page) < get_v_scroll_bar().max_value:
scroll_vertical += SPEED
else:
scroll_back_up()
#SCROLL UP
elif SCROLL == -1:
if scroll_vertical != 0:
scroll_vertical -= SPEED
else:
scroll_to_bottom()
func scroll_back_up():
SCROLL = -1
func scroll_to_bottom():
scroll_vertical = 0 #Reset to top first.
SCROLL = 1