adds a lot holy crap i forgot to commit
This commit is contained in:
14
scenes/tooltip/card_image.gd
Normal file
14
scenes/tooltip/card_image.gd
Normal file
@ -0,0 +1,14 @@
|
||||
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)
|
1
scenes/tooltip/card_image.gd.uid
Normal file
1
scenes/tooltip/card_image.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://cpvbftm0swoa6
|
12
scenes/tooltip/card_text.gd
Normal file
12
scenes/tooltip/card_text.gd
Normal file
@ -0,0 +1,12 @@
|
||||
extends RichTextLabel
|
||||
|
||||
func _set_tip_text(card_info: Dictionary, _card_image: Image) -> void:
|
||||
text = card_info["name"] + " | " + card_info["type"] + "\n"
|
||||
text += card_info["desc"]
|
||||
|
||||
func _clear_tip_text() -> void:
|
||||
text = ""
|
||||
|
||||
func _ready() -> void:
|
||||
EventBus.connect("card_on_hover", _set_tip_text)
|
||||
EventBus.connect("card_on_unhover", _clear_tip_text)
|
1
scenes/tooltip/card_text.gd.uid
Normal file
1
scenes/tooltip/card_text.gd.uid
Normal file
@ -0,0 +1 @@
|
||||
uid://b8tioen4n1rip
|
Reference in New Issue
Block a user