fix: small improvements to positioning
This commit is contained in:
parent
b21ba5e18f
commit
a0d7b69528
|
|
@ -1883,11 +1883,11 @@ transform = Transform3D(-0.7148993, 0, -0.6992254, 0, 1, 0, 0.6992254, 0, -0.714
|
|||
interaction = ExtResource("19_d3c7p")
|
||||
|
||||
[node name="ComicInteractable" parent="logic" instance=ExtResource("22_ks23q")]
|
||||
transform = Transform3D(-0.9699434, 0, -0.24332677, 0, 1, 0, 0.24332677, 0, -0.9699434, 2.91664, 0.43768048, -0.75655603)
|
||||
transform = Transform3D(-0.9699434, 0, -0.24332677, 0, 1, 0, 0.24332677, 0, -0.9699434, 2.806591, 0.11460018, -0.75655603)
|
||||
interaction = ExtResource("13_v3447")
|
||||
|
||||
[node name="ClothesInteractable" parent="logic" instance=ExtResource("22_ks23q")]
|
||||
transform = Transform3D(-0.86042935, 0, 0.5095668, 0, 1, 0, -0.5095668, 0, -0.86042935, 1.5113667, 1.1907816, -0.597433)
|
||||
transform = Transform3D(-0.86042935, 0, 0.5095668, 0, 1, 0, -0.5095668, 0, -0.86042935, 1.376315, 1.0840173, -0.68175197)
|
||||
interaction = ExtResource("12_x3dlb")
|
||||
|
||||
[node name="collectable_particles" parent="logic/ClothesInteractable" index="3"]
|
||||
|
|
|
|||
|
|
@ -40,14 +40,23 @@ func _ready() -> void:
|
|||
func _player_active(value: bool) -> void:
|
||||
active = value
|
||||
|
||||
func collapse() -> void:
|
||||
hover = false
|
||||
if shown:
|
||||
shown = false
|
||||
func expand() -> void:
|
||||
shown = true
|
||||
view.scale = Vector3.ZERO
|
||||
frame.modulate = Color.TRANSPARENT
|
||||
view.rotation.z = -PI*0.5 # Godot angle wrapping is ... something
|
||||
if tween: tween.kill()
|
||||
tween = create_tween().set_ease(Tween.EASE_IN).set_trans(Tween.TRANS_BACK)
|
||||
tween.parallel().tween_property(view, "scale", Vector3.ZERO, 0.3)
|
||||
tween.parallel().tween_property(frame, "modulate:a", 0, 0.6)
|
||||
tween = create_tween().set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_BACK)
|
||||
tween.parallel().tween_property(view, "scale", Vector3.ONE, 1.0).set_delay(0.5)
|
||||
tween.parallel().tween_property(view, "rotation:z", 0, 0.8).set_delay(0.5)
|
||||
tween.parallel().tween_property(frame, "modulate:a", 1.0, 2.0)
|
||||
|
||||
func collapse() -> void:
|
||||
shown = false
|
||||
if tween: tween.kill()
|
||||
tween = create_tween().set_ease(Tween.EASE_IN).set_trans(Tween.TRANS_BACK)
|
||||
tween.parallel().tween_property(view, "scale", Vector3.ZERO, 0.3)
|
||||
tween.parallel().tween_property(frame, "modulate:a", 0, 0.6)
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
_process_hover()
|
||||
|
|
@ -60,22 +69,10 @@ func _process_billboard() -> void:
|
|||
|
||||
func _process_hover() -> void:
|
||||
if active and hover and not shown:
|
||||
shown = true
|
||||
view.scale = Vector3.ZERO
|
||||
frame.modulate = Color.TRANSPARENT
|
||||
view.rotation.z = -PI*0.5 # Godot angle wrapping is ... something
|
||||
if tween: tween.kill()
|
||||
tween = create_tween().set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_BACK)
|
||||
tween.parallel().tween_property(view, "scale", Vector3.ONE, 1.0).set_delay(0.5)
|
||||
tween.parallel().tween_property(view, "rotation:z", 0, 0.8).set_delay(0.5)
|
||||
tween.parallel().tween_property(frame, "modulate:a", 1.0, 2.0)
|
||||
expand()
|
||||
|
||||
elif not hover and shown or shown and not active:
|
||||
shown = false
|
||||
if tween: tween.kill()
|
||||
tween = create_tween().set_ease(Tween.EASE_IN).set_trans(Tween.TRANS_BACK)
|
||||
tween.parallel().tween_property(view, "scale", Vector3.ZERO, 0.3)
|
||||
tween.parallel().tween_property(frame, "modulate:a", 0, 0.6)
|
||||
collapse()
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if not active or not hover or not shown: return
|
||||
|
|
@ -86,6 +83,7 @@ func _input(event: InputEvent) -> void:
|
|||
|
||||
|
||||
func play_story() -> void:
|
||||
collected = true
|
||||
canvas_layer.show()
|
||||
Scenes.begin_sequence(interaction_ui.scene_id)
|
||||
|
||||
|
|
@ -101,6 +99,7 @@ func play_story() -> void:
|
|||
Scenes.end_sequence(interaction_ui.scene_id) # todo: maybe later?
|
||||
|
||||
Scenes.player_enable.emit(true) # TODO: this may not be our job?
|
||||
expand()
|
||||
|
||||
func play_board() -> void:
|
||||
canvas_layer.show()
|
||||
|
|
@ -112,11 +111,13 @@ func play_board() -> void:
|
|||
canvas_layer.hide()
|
||||
|
||||
Scenes.player_enable.emit(true)
|
||||
expand()
|
||||
|
||||
|
||||
func collect_memento() -> void:
|
||||
shown = false
|
||||
collected = true
|
||||
collapse()
|
||||
|
||||
# Hide mouse and collapse other interactables BEFORE showing canvas
|
||||
get_tree().call_group("interactables", "collapse")
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
[sub_resource type="SphereShape3D" id="SphereShape3D_3rbj1"]
|
||||
radius = 0.3
|
||||
|
||||
[node name="Interactable" type="Node3D"]
|
||||
[node name="Interactable" type="Node3D" groups=["interactables"]]
|
||||
transform = Transform3D(-1, 0, 8.742278e-08, 0, 1, 0, -8.742278e-08, 0, -1, 0, 0, 0)
|
||||
script = ExtResource("1_ih54h")
|
||||
metadata/_custom_type_script = "uid://bp6s7vhdd6btk"
|
||||
|
|
|
|||
|
|
@ -57,6 +57,10 @@ enabled=PackedStringArray("res://addons/LineRenderer/plugin.cfg", "res://addons/
|
|||
|
||||
import/blender/enabled=false
|
||||
|
||||
[global_group]
|
||||
|
||||
interactables=""
|
||||
|
||||
[gui]
|
||||
|
||||
theme/custom="res://logic-scenes/themes/handwriting.theme"
|
||||
|
|
|
|||
Loading…
Reference in New Issue