uses lanczos interpolation to make small cards not look terrible
This commit is contained in:
parent
c75aec06ac
commit
0f88bd8f7b
5
card.gd
5
card.gd
@ -62,7 +62,7 @@ func _load_data() -> Error:
|
||||
|
||||
func _load_image() -> Error:
|
||||
# NOTE: Assuming we're going with using the .png cards on board.
|
||||
var cached_img = FileAccess.get_file_as_bytes("user://card_cache/" + card_id + "/card.jpg")
|
||||
var cached_img = FileAccess.get_file_as_bytes("user://card_cache/" + card_id + "/card.png")
|
||||
|
||||
if cached_img.is_empty():
|
||||
push_error("%sCard on-board image was not found in cache" % _card_error("CACHE"))
|
||||
@ -75,6 +75,9 @@ func _load_image() -> Error:
|
||||
push_error("%sCard on-board image failed to load correctly" % _card_error("IMAGE"))
|
||||
return FAILED
|
||||
|
||||
# TODO: Get the size from the node or some constant variable.
|
||||
image.resize(125, 175, Image.INTERPOLATE_LANCZOS)
|
||||
|
||||
var image_texture = ImageTexture.new()
|
||||
image_texture.set_image(image)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user