> For the complete documentation index, see [llms.txt](https://cavonstavants-organization.gitbook.io/rtype-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cavonstavants-organization.gitbook.io/rtype-technical-documentation/index_files/_animation_8hpp.md).

# Animation.hpp

## Namespaces

| Name                                                                                                                  |
| --------------------------------------------------------------------------------------------------------------------- |
| [**anim**](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Files/Namespaces/namespaceanim.md) |

## Classes

|       | Name                                                                                                                                                                                                                                                                                                                 |
| ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| class | <p><a href="https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Files/Classes/classanim_1_1_animation.md"><strong>anim::Animation</strong></a><br><a href="/rtype-technical-documentation/index_files/_animation_8hpp.md">Animation</a> class should be used to create an animation in sfml.</p> |

## Source code

```cpp
/*
** EPITECH PROJECT, 2022
** R-TYPE
** File description:
** Animation
*/

#pragma once

#include <SFML/Graphics.hpp>

namespace anim {
    class Animation {
        public:
            Animation();

            ~Animation() = default;

            void update();

            void addTexture(const std::string &texturePath, const sf::Vector2f &position, const sf::Vector2f &size);

            void addTexture(const sf::Image &image, const sf::Vector2f &position, const sf::Vector2f &size);

            const sf::RectangleShape &getShape() const;

            void moveShape(const sf::Vector2f &move);

            void setDuration(const std::size_t &duration);

            const std::size_t &getDuration() const;

            void setPosition(const sf::Vector2f &position);

            const sf::Vector2f &getPosition() const;

            void setSize(const sf::Vector2f &size);

            const sf::Vector2f &getSize() const;

            const sf::FloatRect getGlobalBounds();

            void setColor(const sf::Color &color);

            const sf::Color &getColor() const;

        private:
            sf::RectangleShape _shape;

            std::vector<sf::Texture> _textures;

            sf::Clock _clock;

            std::size_t _duration;

            std::size_t _textureUsed;
    };
} // namespace gui
```

***

Updated on 2022-11-13 at 17:21:37 +0100
