Use webp instead of jpg for cards
This commit is contained in:
parent
336ae08cd0
commit
aed1a0b69f
1 changed files with 3 additions and 3 deletions
|
@ -32,10 +32,10 @@ onready var texture: Texture = cardImage.get_surface_material(0)
|
||||||
func set_cardid(val: String):
|
func set_cardid(val: String):
|
||||||
cardID = val
|
cardID = val
|
||||||
if ready:
|
if ready:
|
||||||
Remote.fetch(Remote.IMGURL + val + ".jpg", self, "_card_fetched")
|
Remote.fetch(Remote.IMGURL + val + ".webp", self, "_card_fetched")
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
Remote.fetch(Remote.IMGURL + cardID + ".jpg", self, "_card_fetched")
|
Remote.fetch(Remote.IMGURL + cardID + ".webp", self, "_card_fetched")
|
||||||
ready = true
|
ready = true
|
||||||
|
|
||||||
func _mouse_hover():
|
func _mouse_hover():
|
||||||
|
@ -85,7 +85,7 @@ func _check_drop_anim(anim_name):
|
||||||
func _card_fetched(result: int, response_code: int, headers: PoolStringArray, body: PoolByteArray):
|
func _card_fetched(result: int, response_code: int, headers: PoolStringArray, body: PoolByteArray):
|
||||||
assert(result == HTTPRequest.RESULT_SUCCESS)
|
assert(result == HTTPRequest.RESULT_SUCCESS)
|
||||||
var img = Image.new()
|
var img = Image.new()
|
||||||
var err = img.load_jpg_from_buffer(body)
|
var err = img.load_webp_from_buffer(body)
|
||||||
assert(err == OK)
|
assert(err == OK)
|
||||||
# Depending if card pic is a problem or not, rotate the card image mesh
|
# Depending if card pic is a problem or not, rotate the card image mesh
|
||||||
if img.get_width() > img.get_height():
|
if img.get_width() > img.get_height():
|
||||||
|
|
Loading…
Reference in a new issue