Gamedev Framework (gf)  0.20.0
A C++17 framework for 2D games
LightPointEmission.h
1 /*
2  * Gamedev Framework (gf)
3  * Copyright (C) 2016-2021 Julien Bernard
4  *
5  * This software is provided 'as-is', without any express or implied
6  * warranty. In no event will the authors be held liable for any damages
7  * arising from the use of this software.
8  *
9  * Permission is granted to anyone to use this software for any purpose,
10  * including commercial applications, and to alter it and redistribute it
11  * freely, subject to the following restrictions:
12  *
13  * 1. The origin of this software must not be misrepresented; you must not
14  * claim that you wrote the original software. If you use this software
15  * in a product, an acknowledgment in the product documentation would be
16  * appreciated but is not required.
17  * 2. Altered source versions must be plainly marked as such, and must not be
18  * misrepresented as being the original software.
19  * 3. This notice may not be removed or altered from any source distribution.
20  */
21 #ifndef GF_LIGHT_POINT_EMISSION_H
22 #define GF_LIGHT_POINT_EMISSION_H
23 
24 #include "GraphicsApi.h"
25 #include "Sprite.h"
26 #include "Vector.h"
27 
28 namespace gf {
29 #ifndef DOXYGEN_SHOULD_SKIP_THIS
30 inline namespace v1 {
31 #endif
32 
39  class GF_GRAPHICS_API LightPointEmission : public Sprite {
40  public:
42 
43  LightPointEmission(const Texture& texture);
44 
46  m_center = center;
47  }
48 
50  return m_center;
51  }
52 
53  void setSourceRadius(float radius) {
54  m_radius = radius;
55  }
56 
57  float getSourceRadius() const {
58  return m_radius;
59  }
60 
61  void setShadowOverExtendMultiplier(float multiplier) {
62  m_multiplier = multiplier;
63  }
64 
66  return m_multiplier;
67  }
68 
69  void setActive(bool active = true) {
70  m_active = active;
71  }
72 
73  bool isActive() const {
74  return m_active;
75  }
76 
77  private:
78  Vector2f m_center;
79  float m_radius;
80  float m_multiplier;
81  bool m_active = true;
82  };
83 
84 
85 
86 #ifndef DOXYGEN_SHOULD_SKIP_THIS
87 }
88 #endif
89 }
90 
91 #endif // GF_LIGHT_POINT_EMISSION_H
A drawable representation of a texture, with its own transformations, color, etc. ...
Definition: Sprite.h:75
A texture for colored images.
Definition: Texture.h:313
float getShadowOverExtendMultiplier() const
Definition: LightPointEmission.h:65
void setShadowOverExtendMultiplier(float multiplier)
Definition: LightPointEmission.h:61
Light point emission.
Definition: LightPointEmission.h:39
The namespace for gf classes.
Definition: Action.h:35
bool isActive() const
Definition: LightPointEmission.h:73
float getSourceRadius() const
Definition: LightPointEmission.h:57
void setLocaleCastCenter(Vector2f center)
Definition: LightPointEmission.h:45
void setSourceRadius(float radius)
Definition: LightPointEmission.h:53
void setActive(bool active=true)
Definition: LightPointEmission.h:69
General purpose math vector.
Definition: Vector.h:61
Vector2f getLocalCastCenter() const
Definition: LightPointEmission.h:49