Example #1
0
void StaticEntity::setCubeCoordinate(const CoordI& cc)
{
	cube_coordinate_ = cc;
	Vec3f pos = Properties::WorldToPosition(cube_coordinate_);
	setPose(pos);
	Vec3f center_pos = Properties::WorldToPositionCenter(cube_coordinate_);
	setCenterPosition(center_pos);
}
Example #2
0
 void AnimatableSprite::setSprite(sf::Sprite sprite)
 {
     sf::Vector2f center = getCenterPosition();
     sf::Vector2f scale = _sprite.getScale();
     sf::Color color = _sprite.getColor();
     sprite.setScale(scale);
     sprite.setColor(color);
     _sprite = sprite;
     setCenterPosition(center);
 }
Example #3
0
 void AnimatableSprite::setScale(float x, float y)
 {
     sf::Vector2f center = getCenterPosition();
     _sprite.setScale(x, y);
     setCenterPosition(center);
 }