You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
463 B
18 lines
463 B
extends Control
|
|
var in_p : Vector2
|
|
var out_p : Vector2
|
|
var width : float
|
|
@export var weight : float
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
in_p = $"../in".position
|
|
out_p = $"../out".position
|
|
width = $TextureRect.texture.get_size().x
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta):
|
|
position = lerp(in_p -Vector2( width ,0 ), out_p +Vector2( width ,0 ),weight)
|
|
pass
|