Smolgui
Immediate gui library based on SFML
Loading...
Searching...
No Matches
TextureCollage.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <SFML/Graphics/Image.hpp>
6
7namespace sgui
8{
13 CollageOptions () = default;
14 CollageOptions (const sf::Color& c);
15 // data
16 bool useMask = false;
17 sf::Color maskColor = sf::Color::White;
18};
19
24public:
25 struct ImageInfo {
26 sf::Image image;
27 std::string name = "unnamed";
28 };
29public:
35 TextureCollage (const std::string& directory, const CollageOptions& options = {});
39 const sf::Image& image () const { return m_collage; }
43 TextureAtlas& atlas () { return m_atlas; }
44 const TextureAtlas& atlas () const { return m_atlas; }
45private:
46 sf::Image m_collage;
47 TextureAtlas m_atlas;
48};
49
50} // namespace sgui
Contains texture position and sub-box of all sprites for a given sprite sheet. Animations ca be handl...
Definition TextureAtlas.h:28
const sf::Image & image() const
get texture collage
Definition TextureCollage.h:39
TextureAtlas & atlas()
get texture atlas
Definition TextureCollage.h:43
const TextureAtlas & atlas() const
Definition TextureCollage.h:44
TextureCollage(const std::string &directory, const CollageOptions &options={})
build a texture from a collage of all images in the directory
Definition TextureCollage.cpp:15
Definition Interpolation.h:16
Options for collage.
Definition TextureCollage.h:12
bool useMask
Use a mask to suppress a background color.
Definition TextureCollage.h:16
sf::Color maskColor
Background color to be suppressed.
Definition TextureCollage.h:17
CollageOptions()=default
Definition TextureCollage.h:25
sf::Image image
Definition TextureCollage.h:26
std::string name
Definition TextureCollage.h:27