flame icon indicating copy to clipboard operation
flame copied to clipboard

Sprite.load cannot load pictures with different resolutions

Open zhouge870103 opened this issue 4 years ago • 5 comments

Sprite.load cannot load pictures with different resolutions AssetImage is correct

zhouge870103 avatar Nov 04 '21 10:11 zhouge870103

Not sure I understand the issue, Sprite.load can load images of any resolution.

Please edit your issue, add more info and follow the issue template

erickzanardo avatar Nov 04 '21 10:11 erickzanardo

I think they refer to how it is done in AssetImage where you can have several resolutions of the same image and the image with good enough resolution for the pixel density and size will be used. https://api.flutter.dev/flutter/painting/AssetImage-class.html

spydon avatar Nov 04 '21 13:11 spydon

Alright, changing this to improvement then as this is not a bug but rather an enhancement

erickzanardo avatar Nov 04 '21 14:11 erickzanardo

I'll add post-v1 too.

spydon avatar Nov 04 '21 14:11 spydon

Related to #116

spydon avatar May 13 '22 13:05 spydon

After some internal discussion, we decided to not do this. Game engines usually refrain from this since loading textures from an image depends on their size, so automatically changing which image is loaded according to the device resolution can cause some confusion.

erickzanardo avatar Feb 21 '23 21:02 erickzanardo