Hello! I upload a lot of avatars of users from social networks into the game. I do this with the code
http.request(link, "GET", function(self, id, res)
local img = image.load(res.response)
if gui.new_texture(link, img.width, img.height, img.type, img.buffer) then
gui.set_texture(avatar_node, link)
end
end)
But I stumbled on the fact that the number of drawcalls!
Is it possible to collect dynamic user avatars in one atlas and use from
.......
local img = image.load(res.response)
-- avatars is atlas name
if gui.new_texture('avatars/'..link, img.width, img.height, img.type, img.buffer) then
gui.set_texture(avatar_node, 'avatars')
gui.play_flipbook(avatar_node, link)
end
How to download a lot of avatars of users in the game and avoid a big drawcalls!
Very interesting!
Thank you!