added comments
This commit is contained in:
parent
1208973646
commit
6bc5d138bb
1 changed files with 12 additions and 2 deletions
|
|
@ -37,14 +37,24 @@ public class Map {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the pos of the map by the pixel
|
||||
* @param x x pixels
|
||||
* @param y y pixels
|
||||
* @return The pos thats in the coordinates
|
||||
*/
|
||||
public Vector2i getPosByPixel(float x, float y){
|
||||
System.out.println("DOWN: "+x+"-"+y);
|
||||
x = x/POS_SIZE;
|
||||
y = y/POS_SIZE;
|
||||
System.out.println("DOWN: "+x+"-"+y);
|
||||
return new Vector2i((int)x,(int)y);
|
||||
}
|
||||
|
||||
/**
|
||||
* The coordinate of the map pos
|
||||
* @param x x pos
|
||||
* @param y y pos
|
||||
* @return The coordinate of the pos
|
||||
*/
|
||||
public Vector2f getPixelByPos(float x, float y){
|
||||
x = (int)(POS_SIZE*x*1.2f);
|
||||
y = (int)(POS_SIZE*y*1.2f);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue