Blame view

ios/Runner/Wowgame/Classes/game_halloween/HScalingUtils.h 1.43 KB
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
  //
  //  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 */