So I'm trying to update my card album. I first created it with static images being loaded from the pictures folder. there was no lag. when I tried making it card sprites instead, i get like 5 second for them to load. how many card sprites? 140 images being rendered. If I use card sprites, which are layered from 5 different images, I can have my dynamic values displayed anytime to reflect.
i do have a function to export the card images anytime then use them as static image, but it seems like a double task. I am confused.
the lag you're writing about is most likely no lag but loading delay.
and that depends on filesize, not the number of files.
try to increase compression rate of the pictures, but be warned that higher compression means less quality.
i think i have to find a way to make the sprites not cause lag upon generation. i think i have rendundant refreshes too.
It depends on how do you generate the sprites (?), do you have a link to the code, or an example on how do you do that?
Just as a bit of terminology, you may want to be more specific about the differences between the types of files you're talking about.
Any two-dimensional image in a video game is a "sprite."
static sprite is the image in the loaded from the img/pictures folder, while card sprite is the combined layered pictures to be shown in-game. to put in in analogy, its the walking graphics VS the paperdoll walking graphics. so im trying to code the "paper doll" for my cards.
and how many layers do you have?
Or how much is the difference in data needed for both cases?
1 vs 6 layers, i managed to figure things out about the lag, it was the continuous refresh and redraw, i just had to add flags on when to and when not to refresh. my original methods was making redraw all the contents at refresh causing the lag.. but time getting stuck at the resizing rescaling of the cards upon selection, and the card filters. i have to use console logs to detect which step was calling the redundant refreshes thus causing the lag.
This thread is closed due to being reported as solved. If you need it reopened, report it to us to let us know. Thank you!