Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Point pGlobal = (...);
- // Grid coordinates of the tile containing pGlobal
- Point pTileGrid = Point(pGlobal.x / tileSize, pGlobal.y / tileSize);
- // Pixel inside that tile that contains pGlobal
- Point pTile = Point(pGlobal.x % tileSize, pGlobal.y % tileSize);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement