HScalingUtils.h 1.43 KB
//
//  HScalingUtils.h
//  SteveMaggieCpp
//
//  Created by Katarzyna Kalinowska-Górska on 18.05.2017.
//
//

#ifndef HScalingUtils_h
#define HScalingUtils_h

#include "cocos2d.h"

class HScalingUtils //TODO make a singleton
{
    public:
    
        static HScalingUtils& getInstance()
        {
            static HScalingUtils instance;
            return instance;
        }
    
        static bool isSmallDevice();
        static float getScaleForSmallDevice();
        static float getAspectRatioBasedModifierForVelocity();
        static cocos2d::Size getDesignSize();
        void setScaledScreenSurplusSize(float width, float height);
        float getScaledScreenSurplusWidth();
        float getScaledScreenSurplusHeight();
        cocos2d::Point configurePoint(cocos2d::Point point);
        cocos2d::Rect configureRect(cocos2d::Rect rect);
    
        static float scaleAspectFillToDesignIpadProSize();
        static float getScaleForFont();
        static float imageAspectFillGetScale(cocos2d::Size nodeSize, cocos2d::Size targetSize);
        static float configureNodeDimension(float originalDimension);
    
    
    private:
    
        HScalingUtils(){
            this->_scaledScreenSurplusWidth = 0;
            this->_scaledScreenSurplusHeight = 0;
        };
    
        DISALLOW_COPY_AND_ASSIGN(HScalingUtils);
    
        float _scaledScreenSurplusWidth;
        float _scaledScreenSurplusHeight;
    
};

#endif /* HScalingUtils_h */