mirror of
https://github.com/Noratrieb/Java2DGame.git
synced 2026-01-15 22:45:00 +01:00
tf happening
This commit is contained in:
parent
3f719e573a
commit
9f460d499a
4 changed files with 15 additions and 30 deletions
|
|
@ -134,20 +134,10 @@ public abstract class GameObject implements Drawable {
|
|||
|
||||
}
|
||||
|
||||
public Vector2D getMapCoordsSize(Vector2D value) {
|
||||
double x = (value.x / 100d * size.x);
|
||||
double y = (value.y / 100d * size.y);
|
||||
return new Vector2D(x, y);
|
||||
|
||||
}
|
||||
|
||||
public Vector2D getWorldCoordsFromLocal(Vector2D value) {
|
||||
return Coords.getWorldCoords(getMapCoords(value));
|
||||
}
|
||||
|
||||
public Vector2D getWorldCoordsFromLocalSize(Vector2D value) {
|
||||
return Coords.getWorldCoords(getMapCoordsSize(value));
|
||||
}
|
||||
|
||||
public Vector2D getCenterPosition(Vector2D position){
|
||||
return new Vector2D(position.x + size.x / 2, position.y + size.y / 2);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue