How to work with multiple pictures and variables name?
Posted: Tue Nov 02, 2021 5:03 pm
Hi,
How to work with multiple pictures without copy paste a code?
example:
picture1=love.graphics.newImage( filename1, settings )
picture2=love.graphics.newImage( filename2, settings )
picture3=love.graphics.newImage( filename3, settings )
In my code I want to call picture"Number1" and after picture"Number2" ... Without to create a code like this:
if picture1 then
else if picture2 then...
----Reedit----------------------
I have find a way by putting these pictures in a array but I want to free memory usage for not have double picture loaded. If you have the way to unload picture this is welcome.
Thanks
How to work with multiple pictures without copy paste a code?
example:
picture1=love.graphics.newImage( filename1, settings )
picture2=love.graphics.newImage( filename2, settings )
picture3=love.graphics.newImage( filename3, settings )
In my code I want to call picture"Number1" and after picture"Number2" ... Without to create a code like this:
if picture1 then
else if picture2 then...
----Reedit----------------------
I have find a way by putting these pictures in a array but I want to free memory usage for not have double picture loaded. If you have the way to unload picture this is welcome.
Thanks