Middle Europe Productions Library  alpha 1.3.3
Public Member Functions | Friends | List of all members
MEP::TextureObject Class Reference

Basic MEP::Drawable element based on a single texture. More...

#include <TextureObject.h>

Inheritance diagram for MEP::TextureObject:
MEP::Object MEP::Sprite MEP::Drawable MEP::Following

Public Member Functions

 TextureObject (const Object &x, sf::Vector2f pos={ 0.f, 0.f }, sf::Vector2f scale={ 1.f, 1.f })
 
void onResize () override
 
bool draw (sf::RenderWindow &window) override
 
void update (sf::Time &) override
 
void setColor (const sf::Color &color)
 
void setRotation (const float angle)
 
const sf::Color & getColor () const
 
bool isActive () const override
 
virtual void debugOutput (std::ostream &out) const
 
- Public Member Functions inherited from MEP::Object
 Object ()=delete
 
 Object (const Object &x)
 
 Object (const U_int32 ID, const std::string &path, const std::string &filename, bool transparencyM=false)
 
 Object (const U_int32 ID, const std::string &path, const std::string &filename, unsigned int frames, bool transparencyM=false)
 
 Object (const U_int32 ID, std::list< sf::Image > &images, const std::string &filename, bool transparencyM=false)
 
virtual const sf::Vector2u & getSize () const
 
unsigned long getNufTextures () const
 
void entryUpdate (sf::Time &currentTime, bool low=false) override
 
void exitUpdate (sf::Time &currentTime, bool low=false) override
 
ObjectgetObjectPoint ()
 
ObjectgetObjectRef ()
 
const U_int32getID () const
 
const std::string & getName () const
 
virtual bool isTansparent (unsigned int x, unsigned int y)
 
const ObjectTypegetType () const
 
unsigned int nufC () const
 
bool operator== (const std::string &x) const
 
bool operator== (const Object &x) const
 
 ~Object () override
 
- Public Member Functions inherited from MEP::Drawable
void _link (std::shared_ptr< bool > _li)
 
std::shared_ptr< bool > _linkAddr ()
 
const std::shared_ptr< bool > _linkAddr () const
 
bool _isLinked () const
 
U_int32 getDrawTag () const
 
void setDrawTag (const U_int32 tag)
 
bool addDrawTag (const U_int32 tag)
 
bool removeDrawTag (const U_int32 tag)
 
 Drawable ()=default
 
virtual ~Drawable ()
 
- Public Member Functions inherited from MEP::Sprite
 Sprite (const FollowType &followType, sf::Vector2f pos={ 0.f, 0.f }, sf::Vector2f scale={ 1.f, 1.f })
 
 Sprite (sf::Vector2f pos={ 0.f, 0.f }, sf::Vector2f scale={ 1.f, 1.f })
 
Spriteoperator<< (const Sprite &x)
 
sf::Sprite & getSprite ()
 
void updateSprite (sf::Texture &texture)
 
void setPosition (const sf::Vector2f pos) override
 
void setPosition (const Following &x) override
 
virtual void setScale (const sf::Vector2f scale)
 
virtual void setScale (const Following &x)
 
void setRect (const sf::IntRect &rect)
 
void addMethodRect (std::function< sf::IntRect()> method)
 
void updateRect ()
 
const sf::IntRect & getRect () const
 
- Public Member Functions inherited from MEP::Following
 Following (const FollowType &followType, sf::Vector2f pos={ 0.f, 0.f }, sf::Vector2f posFixed={ 0.f, 0.f }, sf::Vector2f scale={ 1.f, 1.f }, sf::Vector2f scaleFixed={ 1.f, 1.f })
 
 Following (sf::Vector2f pos={ 0.f, 0.f }, sf::Vector2f posFixed={ 0.f, 0.f }, sf::Vector2f scale={ 1.f, 1.f }, sf::Vector2f scaleFixed={ 1.f, 1.f })
 
 Following (const Following &x)
 
void updatePosition ()
 
void addMethodPos (std::function< sf::Vector2f()> method)
 
void updateScale ()
 
void addMethodScale (std::function< sf::Vector2f()> method)
 
Followingoperator<< (const Following &x)
 
void setFollow (const AnimationPosition &base, const FollowType type, MEP::U_int32 group=-1)
 
void setFollow (const AnimationColor &base, MEP::U_int32 toFollow=MEP::ColorChannel::ALL, MEP::U_int32 group=-1)
 
void muteFollowGroup (MEP::U_int32 group)
 
void unMuteFollowGroup (MEP::U_int32 group)
 
void fullMuteFollow ()
 
void fullUnMuteFollow ()
 
virtual void movePosition (const sf::Vector2f pos)
 
sf::Vector2f getPosition () const
 
sf::Vector2f getScale () const
 
sf::Vector2f getOriginPosition () const
 
sf::Vector2f getOriginScale () const
 
bool isFollowerActive () const
 
void followingDebug (std::ostream &out, const char *skipLines="") const
 
void clearFollow ()
 

Friends

std::ostream & operator<< (std::ostream &out, const TextureObject &x)
 

Additional Inherited Members

- Public Types inherited from MEP::Object
enum  ObjectType { ObjectType::NotInit, ObjectType::Single, ObjectType::Multi }
 
- Public Types inherited from MEP::Following
enum  FollowType {
  FollowType::NotInit = 0, FollowType::Objects = 1, FollowType::X_Scale = 2, FollowType::Y_Scale = 3,
  FollowType::X_Pos = 4, FollowType::Y_Pos = 5, FollowType::Color = 6
}
 
- Protected Member Functions inherited from MEP::Object
void deleteObject ()
 
- Protected Member Functions inherited from MEP::Drawable
void notify ()
 
void drawTagDebug (std::ostream &out) const
 
- Protected Attributes inherited from MEP::Object
bool transparency = false
 
bool ** table = nullptr
 
sf::Vector2u m_size = {0, 0}
 
std::list< sf::Texture * > * texture
 
ObjectType m_type = Object::ObjectType::NotInit
 
- Protected Attributes inherited from MEP::Sprite
sf::Sprite currentSprite
 
- Protected Attributes inherited from MEP::Following
std::function< sf::Vector2f()> calc_position = [this]()->sf::Vector2f { return m_pos; }
 
std::function< sf::Vector2f()> calc_scale = [this]()->sf::Vector2f { return m_scale; }
 
MEPtools::GroupManager< Follow, std::unique_ptr< Follow >, std::list< std::unique_ptr< Follow > > > followingListv2
 
sf::Vector2f m_pos = {0.f, 0.f}
 
sf::Vector2f m_posMove = { 0.f, 0.f }
 
sf::Vector2f m_posFixed = { 0.f, 0.f }
 
sf::Vector2f m_scale = { 1.f, 1.f }
 
sf::Vector2f m_scaleFixed = { 1.f, 1.f }
 
sf::Color m_color
 
sf::Color m_colorFixed
 

Detailed Description

Basic MEP::Drawable element based on a single texture.

Basic type of a MEP::Drawable element in which the creation of a sf::Sprite is done via a single texture.

Constructor & Destructor Documentation

◆ TextureObject()

MEP::TextureObject::TextureObject ( const Object x,
sf::Vector2f  pos = { 0.f, 0.f },
sf::Vector2f  scale = { 1.f, 1.f } 
)
inline

Constructor of a TextureObject

Parameters
[in]x: MEP::Object
[in]pos: Pos of an MEP::TextureObject
[in]scale: Scale of an MEP::TextureObject

Member Function Documentation

◆ debugOutput()

virtual void MEP::TextureObject::debugOutput ( std::ostream &  out) const
inlinevirtual

Debug output of the class.

Reimplemented from MEP::Object.

◆ draw()

bool MEP::TextureObject::draw ( sf::RenderWindow &  window)
inlineoverridevirtual

Override of a MEP::Drawable draw.

Reimplemented from MEP::Object.

◆ getColor()

const sf::Color& MEP::TextureObject::getColor ( ) const
inlinevirtual

Outputs the color of a main sprite.

Returns
sf::Color

Reimplemented from MEP::Sprite.

◆ isActive()

bool MEP::TextureObject::isActive ( ) const
inlineoverridevirtual

Outputs activity of a texture. It is related to associated animations.

Returns
true - is active, false - otherwise.

Reimplemented from MEP::Object.

◆ onResize()

void MEP::TextureObject::onResize ( )
inlineoverridevirtual

On resize we want to update the position.

Reimplemented from MEP::Drawable.

◆ setColor()

void MEP::TextureObject::setColor ( const sf::Color &  color)
inlinevirtual

Outputs the color of a main sprite.

Returns
sf::Color

Reimplemented from MEP::Sprite.

◆ setRotation()

void MEP::TextureObject::setRotation ( const float  angle)
inline

Sets the rotation of an object. param[in] angle : angle of n rotation.

◆ update()

void MEP::TextureObject::update ( sf::Time &  )
inlineoverridevirtual

Override of a MEP::Drawable update.

Reimplemented from MEP::Object.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const TextureObject x 
)
friend

Overrdie of the << operator for diagnostic purposes.