SDLPP: Allow changing coliders' position
Requires `updateSizeAndPosition` to be run on the parent container
This commit is contained in:
@@ -30,6 +30,14 @@ void CollisionPolygon::updateCollision( int x, int y, int w, int h,
|
||||
position = Vec2D< int >( original.getX() * w + x, original.getY() * h + y );
|
||||
}
|
||||
|
||||
void CollisionPolygon::setPos(const Vec2D<double> &pos) {
|
||||
original = pos;
|
||||
}
|
||||
|
||||
void CollisionPolygon::setPos(double x, double y) {
|
||||
setPos({x, y});
|
||||
}
|
||||
|
||||
int CollisionPolygon::getX() const {
|
||||
return position.getX();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user