Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CellsCalculator
- {
- public:
- CellsCalculator(float screenWidth, float screenHeight,
- unsigned xCellsCount, unsigned yCellsCount) :
- cellWidth{screenWidth / xCellsCount},
- cellHeight{screenHeight / yCellsCount}
- {
- }
- cocos2d::Vec2 getCellPosition(unsigned x, unsigned y)
- {
- return {cellWidth * x + cellWidth / 2.0,
- cellHeight * y + cellHeight / 2.0};
- }
- private:
- float cellWidth;
- float cellHeight;
- }
Add Comment
Please, Sign In to add comment