Can we make arrays or multidimensional arrays of sprites in SFML 2.1/C++?

百般思念 提交于 2019-12-25 02:44:27

问题


My question is very simple. Can we make an array of sprites or images in SFML. For example:

int myArray[] = {1, 2, 3};

Consider index number one, two and three are three different images.
How can we do it? Can anyone explain with some code example?


回答1:


Yes you can!

sf::Sprite array[10] = { ... }


来源:https://stackoverflow.com/questions/20932939/can-we-make-arrays-or-multidimensional-arrays-of-sprites-in-sfml-2-1-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!