Guest User

Untitled

a guest
Oct 22nd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. class CellsCalculator
  2. {
  3. public:
  4. CellsCalculator(float screenWidth, float screenHeight,
  5. unsigned xCellsCount, unsigned yCellsCount) :
  6. cellWidth{screenWidth / xCellsCount},
  7. cellHeight{screenHeight / yCellsCount}
  8. {
  9. }
  10.  
  11. cocos2d::Vec2 getCellPosition(unsigned x, unsigned y)
  12. {
  13. return {cellWidth * x + cellWidth / 2.0,
  14. cellHeight * y + cellHeight / 2.0};
  15. }
  16.  
  17. private:
  18. float cellWidth;
  19. float cellHeight;
  20. }
Add Comment
Please, Sign In to add comment