Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Parent::playAnimation(int frame, double time, std::string path)
- {
- time = time * 1000;//as milliseconds
- for (int i = 0; i <= frame; i++)
- {
- if (frameAnimLine.getElapsedTime().asMilliseconds() >= time / frame)
- {
- frameAnimLine.restart();
- texture.loadFromFile(path + std::to_string(i) + ".png");
- sprite.setTexture(texture);
- cout << i << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement