4、修改XML文件
这个Portraits目录下还应该有个config.xml文件,该文件就设置了目录内的照片对应的球员头像关系。该文件内容如下:
“<record>
<!-- resource manager options -->
<!-- don't preload anything in this folder -->
<boolean id="preload" value="false"/>
<!-- turn off auto mapping -->
<boolean id="amap" value="false"/>
<!-- picture mappings -->
<!-- the following XML maps pictures inside this folder into other positions
in the resource system, which allows this folder to be dropped into any
place in the graphics folder and still have the game pick up the graphics
files from the correct places
-->
<list id="maps">
<record from="353" to="graphics/pictures/person/353/portrait"/>
<record from="3219" to="graphics/pictures/person/3219/portrait"/>
</list>
</record>”
其中我们要添加一行类似“<record from="3219" to="graphics/pictures/person/3219/portrait"/>”的数据进去,(复制粘贴总会吧)
其中前面的3219是指照片文件的名字(当然如果照片你用球员姓名命名,这里就是姓名),后面的3219必须是球员ID!
每增加一个球员的头像,就要增加一行内容,然后保存。