can now edit the scroll size of bg layers

This commit is contained in:
JHDev2006
2025-09-23 20:53:42 +01:00
parent 775104be13
commit 25b62b9787
2 changed files with 13 additions and 1 deletions

View File

@@ -158,6 +158,11 @@ func apply_properties(properties := {}) -> void:
if property_node == null:
return
for i in properties.keys():
if property_node.get(i) is Vector2:
var value = properties[i]
if value is Array:
property_node.set(i, Vector2(value[0], value[1]))
else:
property_node.set(i, properties[i])
func get_variation_json(json := {}) -> Dictionary:

View File

@@ -66,6 +66,9 @@ var sky_scroll_speed := -4.0
const disco_sfx_threshold := [0.05, 0.5, 0.8]
var primary_layer_size = Vector2(512, 512)
var secondary_layer_size = Vector2(512, 512)
var sky_layer_size = Vector2(512, 512)
func set_second_y_offset(value := 0.0) -> void:
second_layer_offset.y = -value
@@ -188,6 +191,10 @@ func update_visuals() -> void:
$SecondaryLayer/Mushrooms.get_node("Tint").visible = can_mushroom_tint
$SecondaryLayer/Trees.get_node("Tint").visible = can_tree_tint
$PrimaryLayer.repeat_size = primary_layer_size
$SecondaryLayer.repeat_size = secondary_layer_size
$SkyLayer.repeat_size = sky_layer_size
var tree_tint_amount = inverse_lerp(1, 0, parallax_amount)
var mushroom_tint_amount = tree_tint_amount
if can_mushroom_tint == false: