Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. Point pGlobal = (...);
  2.  
  3. // Grid coordinates of the tile containing pGlobal
  4. Point pTileGrid = Point(pGlobal.x / tileSize, pGlobal.y / tileSize);
  5. // Pixel inside that tile that contains pGlobal
  6. Point pTile = Point(pGlobal.x % tileSize, pGlobal.y % tileSize);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement