18 lines
427 B
GDScript
18 lines
427 B
GDScript
extends TextureRect
|
|
|
|
|
|
func _set_tip_image(_card_info: Dictionary, card_image: Image) -> void:
|
|
card_image.resize(int(size.x / 1.75), int(size.y), Image.INTERPOLATE_LANCZOS)
|
|
var tex = ImageTexture.new()
|
|
tex.set_image(card_image)
|
|
texture = tex
|
|
|
|
|
|
func _clear_tip_image() -> void:
|
|
texture = null
|
|
|
|
|
|
func _ready() -> void:
|
|
EventBus.connect("card_on_hover", _set_tip_image)
|
|
EventBus.connect("card_on_unhover", _clear_tip_image)
|