使用for循环加载文件? [英] Loading Files using for loop ?

查看:78
本文介绍了使用for循环加载文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我想使用for循环加载15个图像文件.

Hello,
I want to load 15 image files using a for loop.

ViewAdd("Assets/xx.png", Boxes[0][0], Boxes[0][1]);



xx格式从01到16不等
和Box [i] [j]是要加载图像文件的x和y坐标.
现在我该如何使用循环加载它们,而不是一次又一次地写同一行..
谢谢

[edit]紧急情况已删除:这可能对您来说很紧急,但对我们而言并非如此.您所强调的紧迫性只是使我们认为您离开得太晚了,并希望我们为您做这件事.这使某些人烦恼,并且可能减慢响应速度. -OriginalGriff [/edit]



where xx vary form 01 to 16
and Boxes[i][j] are the x and y coordinates where image file is to be loaded.
now how can i load them using a loop instead of writing the same line again and again..
Thankyou

[edit]Urgency deleted: It may be urgent to you, but it isn''t to us. All that your stressing the urgency does is to make us think you have left it too late, and want us to do it for you. This annoys some people, and can slow a response. - OriginalGriff[/edit]

推荐答案

char s[64];
for(i=1;i<=16;++i)
{
sprintf(s,"Assets/%02d.png",i);
ViewAdd(s,.....
}


这篇关于使用for循环加载文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆