// // AniScalingUtils.h // SteveMaggieCpp // // Created by Katarzyna Kalinowska-Górska on 18.05.2017. // // #ifndef AniScalingUtils_h #define AniScalingUtils_h #include "cocos2d.h" class AniScalingUtils //TODO make a singleton { public: static AniScalingUtils& getInstance() { static AniScalingUtils instance; return instance; } static bool isSmallDevice(); static bool isElementTooSmallForSmallDevice(int elementWidth); static float getScaleForSmallDevice(); static float getAspectRatioBasedModifierForVelocity(); static cocos2d::Size getDesignSize(); static float getDesignDpi(); void setScaledScreenSurplusSize(float width, float height); float getScaledScreenSurplusWidth(); float getScaledScreenSurplusHeight(); cocos2d::Point configurePoint(cocos2d::Point point); cocos2d::Rect configureRect(cocos2d::Rect rect); static float widthScale(); static float heightScale(); static float scaleAspectFitToDesignIpadProSize(); static float scaleAspectFillToDesignIpadProSize(); static float getScaleForFont(); static float imageAspectFillGetScale(cocos2d::Size nodeSize, cocos2d::Size targetSize); static float imageAspectFitGetScale(cocos2d::Size nodeSize, cocos2d::Size targetSize); static float configureNodeDimension(float originalDimension); static float getDeviceAspectRatio(); private: AniScalingUtils(){ this->_scaledScreenSurplusWidth = 0; this->_scaledScreenSurplusHeight = 0; }; DISALLOW_COPY_AND_ASSIGN(AniScalingUtils); float _scaledScreenSurplusWidth; float _scaledScreenSurplusHeight; }; #endif /* AniScalingUtils_h */