uses lanczos interpolation to make small cards not look terrible

This commit is contained in:
ShyProton 2025-04-23 22:27:04 -04:00
parent c75aec06ac
commit 0f88bd8f7b
2 changed files with 4 additions and 3 deletions

View File

@ -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)

View File

@ -7,6 +7,4 @@ offset_left = 794.0
offset_top = 79.0
offset_right = 919.0
offset_bottom = 254.0
expand_mode = 5
stretch_mode = 4
script = ExtResource("1_kikvd")