Is there faster way to do this? I have 36 different pictures, when the picture changes, i have a string that tracks the image (rotation), image1 is rotation = 1 and so on, what i have to do is use 36 if statements like this:
if (rotation == 1) //This is picture1
{
}
else if (rotation == 2) //This is picture2
{
}
all the way up to:
else if (rotation == 36) //This is picture36
{
}
Is there any way figure out what rotation it is with only like 1 or 2 lines of code?
And any who would say check before you ask, i have checked and i found nothing that would help, if you found something, please post it here.
The inside of my if statements are just for changing the image.
Thanks.
Either use an array
or perhaps actually name the image after the index (e.g.
image01.jpg,image02.jpgetc.)The array strikes me as the most extensible and concise solution.