123456789101112131415161718192021222324 |
- extends Node2D
-
- onready var texture : TextureRect = $TextureRect
-
- var force_stop = false
- var moving = false
-
- func stop():
- moving = false
- force_stop = true
- texture.material.set_shader_param("scroll_speed", 0)
-
- func start():
- moving = true
- force_stop = false
- texture.material.set_shader_param("scroll_speed", 0.2)
-
- func _process(delta):
- if not force_stop:
- if get_tree().paused and moving:
- stop()
- force_stop = false
- elif not get_tree().paused and not moving:
- start()
|