• <small id='7dcyc'></small><noframes id='7dcyc'>

  • <tfoot id='7dcyc'></tfoot><legend id='7dcyc'><style id='7dcyc'><dir id='7dcyc'><q id='7dcyc'></q></dir></style></legend>
    1. <i id='7dcyc'><tr id='7dcyc'><dt id='7dcyc'><q id='7dcyc'><span id='7dcyc'><b id='7dcyc'><form id='7dcyc'><ins id='7dcyc'></ins><ul id='7dcyc'></ul><sub id='7dcyc'></sub></form><legend id='7dcyc'></legend><bdo id='7dcyc'><pre id='7dcyc'><center id='7dcyc'></center></pre></bdo></b><th id='7dcyc'></th></span></q></dt></tr></i><div id='7dcyc'><tfoot id='7dcyc'></tfoot><dl id='7dcyc'><fieldset id='7dcyc'></fieldset></dl></div>

          <bdo id='7dcyc'></bdo><ul id='7dcyc'></ul>

        当我转换为视网膜显示时,瓷砖地图的位置错误

        wrong position of tile map when i convert to retina display(当我转换为视网膜显示时,瓷砖地图的位置错误)

          <tbody id='xyhqY'></tbody>

        <small id='xyhqY'></small><noframes id='xyhqY'>

            1. <i id='xyhqY'><tr id='xyhqY'><dt id='xyhqY'><q id='xyhqY'><span id='xyhqY'><b id='xyhqY'><form id='xyhqY'><ins id='xyhqY'></ins><ul id='xyhqY'></ul><sub id='xyhqY'></sub></form><legend id='xyhqY'></legend><bdo id='xyhqY'><pre id='xyhqY'><center id='xyhqY'></center></pre></bdo></b><th id='xyhqY'></th></span></q></dt></tr></i><div id='xyhqY'><tfoot id='xyhqY'></tfoot><dl id='xyhqY'><fieldset id='xyhqY'></fieldset></dl></div>
                <bdo id='xyhqY'></bdo><ul id='xyhqY'></ul>
                <legend id='xyhqY'><style id='xyhqY'><dir id='xyhqY'><q id='xyhqY'></q></dir></style></legend>
              • <tfoot id='xyhqY'></tfoot>
                  本文介绍了当我转换为视网膜显示时,瓷砖地图的位置错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我遵循将平铺地图转换为 Retina 显示的指南,将宽度和高度的大小也更改为对象的两倍大小和位置.但是正常显示的结果与retina display的结果不一样,正常显示是正确的,但retina显示不正确

                  I follow guide of converting tile map for retina display by changing size of width and height to double size and position of object too. but the result on normal display is not same as retina display normal display is correct but retina display is not correct

                  这是非视网膜平铺地图

                  这是视网膜平铺贴图

                  我还在视网膜 .tmx 文件中添加了 -hd 后缀

                  I also add -hd suffix to retinal .tmx file

                  有什么问题吗?

                  推荐答案

                  我也发现cocos2D tile map有同样的问题,最后通过划分CC_CONTENT_SCALE_FACTOR解决了.在视网膜模式下,它提供 2.0.

                  Me also observed same problem with cocos2D tile map and finally resolved by dividing CC_CONTENT_SCALE_FACTOR. In retina mode it gives 2.0.

                  CCTMXObjectGroup *objects = [tileMap objectGroupNamed:NN_TILE_MAP_OBJECT_LAYER];
                  
                  CGSize s = [[CCDirector sharedDirector] winSize];
                  
                  NSMutableDictionary *newtonPos = [objects objectNamed:NN_NEWTON_POS];        
                  
                  if(newtonPos)
                  {
                      float x = ([[newtonPos valueForKey:@"x"] floatValue])/CC_CONTENT_SCALE_FACTOR();
                      float y = [[newtonPos valueForKey:@"y"] floatValue]/CC_CONTENT_SCALE_FACTOR();
                  
                      MyGameScreen *p = (MyGameScreen*)self.parentLayer;
                      p.gameActor.position = ccp(x, y);
                  }
                  

                  //我用这个函数来获取和弦..

                  //I used this function to get chord..

                  - (CGPoint)getTileCoordForPosition:(CGPoint)position
                  {
                      int maxTileCol = self.mapSize.height; 
                  
                      int x = ( (position.x-self.position.x)/TILE_SIZE);
                      int y = maxTileCol - ( ((position.y)-self.position.y)/TILE_SIZE);
                  
                      if( x >= TILE_IN_ROW)
                          x = TILE_IN_ROW - 1;
                  
                      if( y >= TILE_IN_COL)
                          y = TILE_IN_COL - 1;
                  
                      return ccp(x, y);
                  
                  }
                  

                  这篇关于当我转换为视网膜显示时,瓷砖地图的位置错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
                  Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)
                  Resume game cocos2d(恢复游戏 cocos2d)
                  Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))
                  Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)
                  Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)

                    • <tfoot id='owoPW'></tfoot>

                        <legend id='owoPW'><style id='owoPW'><dir id='owoPW'><q id='owoPW'></q></dir></style></legend>
                          <tbody id='owoPW'></tbody>
                            <bdo id='owoPW'></bdo><ul id='owoPW'></ul>

                          • <i id='owoPW'><tr id='owoPW'><dt id='owoPW'><q id='owoPW'><span id='owoPW'><b id='owoPW'><form id='owoPW'><ins id='owoPW'></ins><ul id='owoPW'></ul><sub id='owoPW'></sub></form><legend id='owoPW'></legend><bdo id='owoPW'><pre id='owoPW'><center id='owoPW'></center></pre></bdo></b><th id='owoPW'></th></span></q></dt></tr></i><div id='owoPW'><tfoot id='owoPW'></tfoot><dl id='owoPW'><fieldset id='owoPW'></fieldset></dl></div>

                            <small id='owoPW'></small><noframes id='owoPW'>