client: cards can now be clicked
This commit is contained in:
+14
-6
@@ -17,15 +17,23 @@ func _ready() -> void:
|
||||
|
||||
func move_to(new_x_position: float) -> void:
|
||||
#self.position.x = new_x_position
|
||||
var tween = create_tween()
|
||||
tween.set_trans(Tween.TRANS_BACK)
|
||||
tween.set_ease(Tween.EASE_OUT)
|
||||
tween.tween_property(self, "position:x", new_x_position, move_duration)
|
||||
_get_new_tween().tween_property(self, "position:x", new_x_position, move_duration)
|
||||
|
||||
func select() -> void:
|
||||
_get_new_tween().tween_property(self, "position:y", 0.36, move_duration)
|
||||
|
||||
func unselect() -> void:
|
||||
_get_new_tween().tween_property(self, "position:y", 0.0, move_duration)
|
||||
|
||||
func set_front_texture(texture: Texture) -> void:
|
||||
card_mesh.get_surface_override_material(0).albedo_texture = front_texture
|
||||
|
||||
func _get_new_tween() -> Tween:
|
||||
var tween = create_tween()
|
||||
tween.set_trans(Tween.TRANS_BACK)
|
||||
tween.set_ease(Tween.EASE_OUT)
|
||||
return tween
|
||||
|
||||
func _on_input_event(camera: Node, event: InputEvent, event_position: Vector3, normal: Vector3, shape_idx: int) -> void:
|
||||
if event.is_action_pressed("left_mouse_button"):
|
||||
print("yahaha!")
|
||||
if event.is_action_released("left_mouse_button"):
|
||||
card_clicked.emit(self)
|
||||
|
||||
Reference in New Issue
Block a user