Well, I have the following code:
{
int alfa = CC_RADIANS_TO_DEGREES(atan2(normalized.y, -normalized.x)) + 180;
NSString * counting = [NSString stringWithFormat:@"fdfg%d.png", alfa];
}
int alfa
brings a number between 0
and 360
.
What I am trying to achieve is that counting
string value is equal to a image file, i have 360 image files, all with this format "fdfg0000.png" "fdfg0024.png" "fdfg0360.png
", increasing from 0 to 360, and so on...
the %d
operator is not reading the value, because all the zeros leading the file name are already outputted by the program that creates them, without a chance to modify them, I have renamed 360 files manually to this format : "fdfg1.png"
"fdfg24.png"
"fdfg340.png"
, and thats the format that %d reads properly.
So my question is, is there anyway to read all the four zeros that the original file includes in a operator function?
Or does anyone know a way to rename 360 files automatically?