Peoplemon  0.1.0
Peoplemon 3 game source documentation
LightPreview.cpp
Go to the documentation of this file.
2 
3 #include <Core/Resources.hpp>
4 
5 namespace editor
6 {
7 namespace component
8 {
9 LightPreview::Ptr LightPreview::create(const sf::Vector2f& size) {
10  return Ptr(new LightPreview(size));
11 }
12 
13 LightPreview::LightPreview(const sf::Vector2f& size)
14 : Image(ImageManager::load("EditorResources/lightpreview.png")) {
15  scaleToSize(size);
16 }
17 
18 void LightPreview::setLightLevel(std::uint8_t a) {
19  setColor(sf::Color(a, a, a, 255), sf::Color::Transparent);
20 }
21 
22 } // namespace component
23 } // namespace editor
bl::resource::ResourceManager< sf::Image > ImageManager
Definition: Resources.hpp:18
All classes and functionality used for implementing the game editor.
Definition: Tile.hpp:11
Helper component that displays an image with a light level overlaid on it.
std::shared_ptr< LightPreview > Ptr
void setLightLevel(std::uint8_t level)
Sets the light level to display.
static Ptr create(const sf::Vector2f &size)
Create a new LightPreview component.
Definition: LightPreview.cpp:9