We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 483ce12 + 00a10d1 commit 90693e9Copy full SHA for 90693e9
BombingAdventure/Classes/Entity.cpp
@@ -20,9 +20,13 @@ void Entity::bind_sprite(Sprite *sprite) {
20
this->addChild(entity_sprite);
21
22
/* Reset the content size and fit the mid-points */
23
- Size entity_size = entity_sprite->getContentSize();
24
- entity_sprite->setPosition(Vec2(entity_size.width * 0.5f, entity_size.height * 0.5f));
25
- this->setContentSize(entity_size);
+
+ Size entity_size = entity_sprite->getContentSize();
+ entity_sprite->setAnchorPoint(Vec2(0.5,0.5));
26
+ this->setAnchorPoint(Vec2(0.5, 0.5));
27
+ entity_sprite->setPosition(Vec2(entity_size.width * 0.5f, entity_size.height * 0.5f));
28
+ this->setContentSize(entity_size);
29
30
}
31
void Entity::reset_position() {
32
if(get_sprite() != NULL) {
0 commit comments