MEP::Following keeps track of a MEP::Object position.
More...
#include <Following.h>
|
| | 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) |
| |
| Following & | operator<< (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 | setPosition (const sf::Vector2f pos) |
| |
| virtual void | setPosition (const Following &x) |
| |
| virtual void | movePosition (const sf::Vector2f pos) |
| |
| virtual void | setScale (const sf::Vector2f scale) |
| |
| virtual void | setScale (const Following &x) |
| |
| virtual void | setColor (const sf::Color &color) |
| |
| virtual const sf::Color & | getColor () const |
| |
| 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 () |
| |
MEP::Following keeps track of a MEP::Object position.
◆ FollowType
◆ Following() [1/3]
| 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 } |
|
) |
| |
|
inline |
Constructor of a following type.
- Parameters
-
| [in] | followType | : MEP::Following::FollowType type of an animation. |
| [in] | pos | : Position of the follower. |
| [in] | posFixed | : Fixed position of the follower. |
| [in] | scale | : Scale of the follower. |
| [in] | scaleFixed | : Fixed scale of the follower. |
◆ Following() [2/3]
| MEP::Following::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 } |
|
) |
| |
|
inline |
Constructor of a following type.
- Parameters
-
| [in] | pos | : Position of the follower. |
| [in] | posFixed | : Fixed position of the follower. |
| [in] | scale | : Scale of the follower. |
| [in] | scaleFixed | : Fixed scale of the follower. |
◆ Following() [3/3]
| MEP::Following::Following |
( |
const Following & |
x | ) |
|
|
inline |
Warning list of the following objects is individual for every object. Copy constructor does not copy them. Copy constructor copy position, scale and color.
- Parameters
-
◆ addMethodPos()
| void MEP::Following::addMethodPos |
( |
std::function< sf::Vector2f()> |
method | ) |
|
|
inline |
Adds a method of calculation the position.
- Parameters
-
| [in] | method | : A method of calculating the position. |
◆ addMethodScale()
| void MEP::Following::addMethodScale |
( |
std::function< sf::Vector2f()> |
method | ) |
|
|
inline |
Adds a method of calculation the scale.
- Parameters
-
| [in] | method | : A method of calculating the position. |
◆ clearFollow()
| void MEP::Following::clearFollow |
( |
| ) |
|
|
inline |
Clears the follower list.
◆ followingDebug()
| void MEP::Following::followingDebug |
( |
std::ostream & |
out, |
|
|
const char * |
skipLines = "" |
|
) |
| const |
|
inline |
◆ fullMuteFollow()
| void MEP::Following::fullMuteFollow |
( |
| ) |
|
|
inline |
Full mute of the following objects.
◆ fullUnMuteFollow()
| void MEP::Following::fullUnMuteFollow |
( |
| ) |
|
|
inline |
Full mute of the following objects.
◆ getColor()
| virtual const sf::Color& MEP::Following::getColor |
( |
| ) |
const |
|
inlinevirtual |
◆ getOriginPosition()
| sf::Vector2f MEP::Following::getOriginPosition |
( |
| ) |
const |
|
inline |
Outputs the position of the MEP::Folowing
- Returns
- Position.
◆ getOriginScale()
| sf::Vector2f MEP::Following::getOriginScale |
( |
| ) |
const |
|
inline |
Outputs the scale of the MEP::Folowing
- Returns
- Scale.
◆ getPosition()
| sf::Vector2f MEP::Following::getPosition |
( |
| ) |
const |
|
inline |
Outputs the current position of the MEP::Folowing
- Returns
- Fixed position.
◆ getScale()
| sf::Vector2f MEP::Following::getScale |
( |
| ) |
const |
|
inline |
Outputs the current scale of the MEP::Folowing
- Returns
- Fixed scale.
◆ isFollowerActive()
| bool MEP::Following::isFollowerActive |
( |
| ) |
const |
|
inline |
Outputs the information about MEP::Following activity.
- Returns
- true - if atleast one istance of the Follwer is active, false - otherwise.
◆ movePosition()
| virtual void MEP::Following::movePosition |
( |
const sf::Vector2f |
pos | ) |
|
|
inlinevirtual |
Moves the position by given value.
- Parameters
-
| [in] | pos | : Position change. |
◆ muteFollowGroup()
Mutes a group of objects.
◆ operator<<()
Warning list of the following objects is indivdual for every object. Assign operator does not copy them. Assign operator copy position, scale and color.
- Parameters
-
◆ setColor()
| virtual void MEP::Following::setColor |
( |
const sf::Color & |
color | ) |
|
|
inlinevirtual |
◆ setFollow() [1/2]
◆ setFollow() [2/2]
◆ setPosition() [1/2]
| virtual void MEP::Following::setPosition |
( |
const Following & |
x | ) |
|
|
inlinevirtual |
◆ setPosition() [2/2]
| virtual void MEP::Following::setPosition |
( |
const sf::Vector2f |
pos | ) |
|
|
inlinevirtual |
◆ setScale() [1/2]
| virtual void MEP::Following::setScale |
( |
const Following & |
x | ) |
|
|
inlinevirtual |
◆ setScale() [2/2]
| virtual void MEP::Following::setScale |
( |
const sf::Vector2f |
scale | ) |
|
|
inlinevirtual |
◆ unMuteFollowGroup()
| void MEP::Following::unMuteFollowGroup |
( |
MEP::U_int32 |
group | ) |
|
|
inline |
Unmutes a group of objects.
◆ updatePosition()
| void MEP::Following::updatePosition |
( |
| ) |
|
|
inline |
Updates the position of an object according the the given method. If method is not specified does not change anything.
◆ updateScale()
| void MEP::Following::updateScale |
( |
| ) |
|
|
inline |
Updates the scale of an object according the the given method. If method is not specified does not change anything.
◆ calc_position
| std::function<sf::Vector2f()> MEP::Following::calc_position = [this]()->sf::Vector2f { return m_pos; } |
|
protected |
◆ calc_scale
| std::function<sf::Vector2f()> MEP::Following::calc_scale = [this]()->sf::Vector2f { return m_scale; } |
|
protected |
◆ followingListv2
| MEPtools::GroupManager<Follow, std::unique_ptr<Follow>, std::list<std::unique_ptr<Follow> > > MEP::Following::followingListv2 |
|
protected |
◆ m_color
| sf::Color MEP::Following::m_color |
|
protected |
◆ m_colorFixed
| sf::Color MEP::Following::m_colorFixed |
|
protected |
◆ m_pos
| sf::Vector2f MEP::Following::m_pos = {0.f, 0.f} |
|
protected |
◆ m_posFixed
| sf::Vector2f MEP::Following::m_posFixed = { 0.f, 0.f } |
|
protected |
◆ m_posMove
| sf::Vector2f MEP::Following::m_posMove = { 0.f, 0.f } |
|
protected |
◆ m_scale
| sf::Vector2f MEP::Following::m_scale = { 1.f, 1.f } |
|
protected |
◆ m_scaleFixed
| sf::Vector2f MEP::Following::m_scaleFixed = { 1.f, 1.f } |
|
protected |