Gamedev Framework (gf)  0.20.0
A C++17 framework for 2D games
Public Member Functions | List of all members
gf::LightShape Class Reference

Light shape. More...

#include <gf/LightShape.h>

Inheritance diagram for gf::LightShape:
Inheritance graph
[legend]

Public Member Functions

 LightShape (const Polygon &polygon, LightShapeVisibility visibility=LightShapeVisibility::Apparent)
 
 LightShape (Polygon &&polygon, LightShapeVisibility visibility=LightShapeVisibility::Apparent)
 
 LightShape (const RectF &rect, LightShapeVisibility visibility=LightShapeVisibility::Apparent)
 
 LightShape (const CircF &circ, LightShapeVisibility visibility=LightShapeVisibility::Apparent)
 
std::size_t getPointCount () const
 
Vector2f getPoint (std::size_t index) const
 
Vector2f getPrevPoint (std::size_t index) const
 
Vector2f getNextPoint (std::size_t index) const
 
void setColor (const Color4f &color)
 
Color4f getColor () const
 
void setVisibility (LightShapeVisibility visibility)
 
LightShapeVisibility getVisibility () const
 
void setActive (bool active=true)
 
bool isActive () const
 
RectF getLocalBounds () const
 
void setAnchor (Anchor anchor)
 
void draw (RenderTarget &target, const RenderStates &states) override
 Draw the object to a render target. More...
 
- Public Member Functions inherited from gf::Transformable
 Transformable ()
 Default constructor. More...
 
void setOrigin (Vector2f origin)
 Set the local origin of the object. More...
 
Vector2f getOrigin () const
 Get the local origin of the object. More...
 
void setPosition (Vector2f position)
 Set the position of the object. More...
 
Vector2f getPosition () const
 Get the position of the object. More...
 
void move (Vector2f offset)
 Move the object by a given offset. More...
 
void setRotation (float angle)
 Set the orientation of the object. More...
 
float getRotation () const
 Get the orientation of the object. More...
 
void rotate (float angle)
 Rotate the object. More...
 
void setScale (Vector2f factors)
 Set the scale factors of the object. More...
 
void setScale (float factor)
 Set the scale factor of the object. More...
 
Vector2f getScale () const
 Get the current scale of the object. More...
 
void scale (Vector2f factors)
 Scale the object. More...
 
void scale (float factor)
 Scale the object. More...
 
Matrix3f getTransform () const
 Get the combined transform of the object. More...
 
Matrix3f getInverseTransform () const
 Get the inverse of the combined transform of the object. More...
 
- Public Member Functions inherited from gf::Drawable
virtual ~Drawable ()
 Virtual desctructor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from gf::Transformable
void setOriginFromAnchorAndBounds (Anchor anchor, const RectF &bounds)
 Set the origin from an anchor and bounds. More...
 

Detailed Description

Light shape.

See also
gf::LightSystem

Constructor & Destructor Documentation

◆ LightShape() [1/4]

gf::LightShape::LightShape ( const Polygon polygon,
LightShapeVisibility  visibility = LightShapeVisibility::Apparent 
)

◆ LightShape() [2/4]

gf::LightShape::LightShape ( Polygon &&  polygon,
LightShapeVisibility  visibility = LightShapeVisibility::Apparent 
)

◆ LightShape() [3/4]

gf::LightShape::LightShape ( const RectF rect,
LightShapeVisibility  visibility = LightShapeVisibility::Apparent 
)

◆ LightShape() [4/4]

gf::LightShape::LightShape ( const CircF circ,
LightShapeVisibility  visibility = LightShapeVisibility::Apparent 
)

Member Function Documentation

◆ draw()

void gf::LightShape::draw ( RenderTarget target,
const RenderStates states 
)
overridevirtual

Draw the object to a render target.

This is a pure virtual function that has to be implemented by the derived class to define how the drawable should be drawn.

Parameters
targetRender target to draw to
statesCurrent render states

Implements gf::Drawable.

◆ getColor()

Color4f gf::LightShape::getColor ( ) const

◆ getLocalBounds()

RectF gf::LightShape::getLocalBounds ( ) const

◆ getNextPoint()

Vector2f gf::LightShape::getNextPoint ( std::size_t  index) const

◆ getPoint()

Vector2f gf::LightShape::getPoint ( std::size_t  index) const

◆ getPointCount()

std::size_t gf::LightShape::getPointCount ( ) const

◆ getPrevPoint()

Vector2f gf::LightShape::getPrevPoint ( std::size_t  index) const

◆ getVisibility()

LightShapeVisibility gf::LightShape::getVisibility ( ) const

◆ isActive()

bool gf::LightShape::isActive ( ) const
inline

◆ setActive()

void gf::LightShape::setActive ( bool  active = true)
inline

◆ setAnchor()

void gf::LightShape::setAnchor ( Anchor  anchor)

◆ setColor()

void gf::LightShape::setColor ( const Color4f color)

◆ setVisibility()

void gf::LightShape::setVisibility ( LightShapeVisibility  visibility)