屏幕适配后坐标错位了,求大神帮看看

在800480分辨率当我鱼会移动到鼠标点击的地方,但是我换成480320的时候,鱼会移动到鼠标点击的后面。(我把鱼加载背景上,背景是800480 的)我测试一下。在480320分辨率下,
直接设置鱼的位置是(0,480)时候,鱼刚刚好在屏幕的坐上角
一下是适配代码
#include “AppDelegate.h”
glview->setFrameSize(480,320);
//glview->setFrameSize(800,480);
Size disignSize = glview->getFrameSize();
//glview->setFrameSize(960,640);
glview->setDesignResolutionSize(480, 320, ResolutionPolicy::NO_BORDER);

#include “GameScene.h”
CCSize visibleSize = Director::getInstance()->getVisibleSize();
SCREEN_W = visibleSize.width;
SCREEN_H = visibleSize.height;
SCALE_X = (float)SCREEN_W/800;
SCALE_Y = (float)SCREEN_H/480;

 mainLayer = Layer::create();
mainLayer->setContentSize(Size(SCREEN_W,SCREEN_H));
mainLayer->setPosition(VISIBLEPOINT);
mainLayer->ignoreAnchorPointForPosition(false);
mainLayer->setAnchorPoint(ccp(0,0));
mainLayer->setScaleX(SCALE_X);
mainLayer->setScaleY(SCALE_Y);
addChild(mainLayer);

自己顶一下,求大神,大神你在哪里!!!!!!:6:

if ( !CCLayer::init() )
{
return false;
}
//注册触摸
EventListenerTouchOneByOne* listener = EventListenerTouchOneByOne::create();
listener->onTouchBegan = CC_CALLBACK_2(GameScene::onTouchBegan, this);
listener->onTouchMoved = CC_CALLBACK_2(GameScene::onTouchMoved, this);
listener->onTouchEnded = CC_CALLBACK_2(GameScene::onTouchEnded, this);
listener->onTouchCancelled = CC_CALLBACK_2(GameScene::onTouchCancelled, this);
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);

//加载uilayer
 mainLayer = Layer::create();
mainLayer->setContentSize(Size(SCREEN_W,SCREEN_H));
mainLayer->setPosition(VISIBLEPOINT);
Layout* _layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("GameScene_1/GameScene_1.json"));
mainLayer->ignoreAnchorPointForPosition(false);
mainLayer->setAnchorPoint(ccp(0,0));
 mainLayer->setScaleX(SCALE_X);
 mainLayer->setScaleY(SCALE_Y);
mainLayer->addChild(_layout);
addChild(mainLayer);    
rootLayout = (Layout *)mainLayer->getChildByTag(1);
//注册触摸


//初始化参数
initParameters();

fishArray = Array::create();
fishArray->retain();

myFish = MyFish::creat();
myFish->initTextureWithFrameName("swim_cycle.1.jpg");
myFish->initSwimAni("swim_cycle.",14);
myFish->initEatAni("eat_cycle.",3);
myFish->initHurtAni("l",3);
myFish->setPosition(SCREEN_W /2 , SCREEN_H / 2);
myFish->swim();
myFish->boold = 100;
myFish->m_isPlayer = true;
fishArray->addObject(myFish);
rootLayout->addChild(myFish);

源码

:10: :10: :10: :10: :10: :10: :10:

我不知道你的适配方法对不对,你看下以下的代码,放到程序里边试试,我做游戏的时候一直都是用的下面的代码,基本都没问题,你参考下。

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    CCDirector* pDirector = CCDirector::sharedDirector();
    CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();

    pDirector->setOpenGLView(pEGLView);

    // turn on display FPS
    pDirector->setDisplayStats(true);

    // set FPS. the default value is 1.0/60 if you don't call this
    pDirector->setAnimationInterval(1.0 / 60);

    //以下就是如何进行适配的具体方法
    //getFrameSize()获得实际屏幕的大小
     CCSize frameSize = pEGLView->getFrameSize();
     //这填写的就是一般你作为背景图片的那种图片的大小,适配的原理就是放到和缩小,而以什么为参照,当然就是
     //以最大的那张图片为参照,什么图片最大,当然是背景图片了,以后美工做图的时候用的就是以下的这个尺寸
     CCSize winSize=CCSize(480,320);

     //将宽和高做一个比,通过这个比,来具体的调整逻辑分辨率的大小
     float widthRate = frameSize.width/winSize.width;
     float heightRate = frameSize.height/winSize.height;

     //如果是if中的语句,说明逻辑的高度有点大了,就把逻辑的高缩小到和宽度一样的比率
    if (widthRate > heightRate)
    {
        //里边传入的前俩个参数就是逻辑分辨率的大小,也就是通过getWinSize()得到的大小
        pEGLView->setDesignResolutionSize(winSize.width,
            winSize.height*heightRate/widthRate, kResolutionNoBorder);
    }
    else
    {
        pEGLView->setDesignResolutionSize(winSize.width*widthRate/heightRate, winSize.height,
            kResolutionNoBorder);
    }

    // create a scene. it's an autorelease object
    CCScene *pScene = HelloWorld::scene();

    // run
    pDirector->runWithScene(pScene);

    //pEGLView->setDesignResolutionSize(480, 320, kResolutionShowAll);

    return true;
}

```