Issue when scaling down a ScrollView

  • fechox
    Likes 0

    Problem Description

    This is the issue.

    I have originally set the resolution to this cc.view.setDesignResolutionSize(640, 1136, cc.ResolutionPolicy.FIXED_HEIGHT);

    and I have the follwoing menu: https://drive.google.com/open?id=0ByF2MyhrYuZVVU9nUlJib0w5REk

    Under those conditions, everything works fine, scrolling is fine, all perfect, but in order to run the game on smaller screens I set the resolution to this: cc.view.setDesignResolutionSize(320, 480, cc.ResolutionPolicy.FIXED_HEIGHT);

    and then scale it down to 0.4, the menu then looks like this: https://drive.google.com/open?id=0ByF2MyhrYuZVTUJyTHNvMGRBZHc

    Here’s the code:

            var scrollVMenu = new ccui.ScrollView();
            scrollVMenu.setDirection(ccui.ScrollView.DIR_VERTICAL);
            scrollVMenu.setBounceEnabled(true);
            scrollVMenu.setAnchorPoint(0.5,0.5);
            scrollVMenu.setPosition(scrWidth/2,scrHeight/2);
            scrollVMenu.setContentSize(615,775);
            scrollVMenu.setInnerContainerSize(cc.size(700,2200));
            scrollVMenu.setScale(SFACTOR_X, SFACTOR_Y);
            this.addChild(scrollVMenu,1);

    //…………..here I create the buttons for the menu…………….

            var menuLevel = new cc.Menu(arrMenuItems);
            menuLevel.setAnchorPoint(0.0,1.0);
            menuLevel.setPosition(cc.p(300,1120));
            menuLevel.alignItemsInColumns(3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3);
            scrollVMenu.addChild(menuLevel);

    Any ideas?

     

     

     

     


  • Sonar Systems admin
    Likes 0

    We are actually creating a new series which will launch within 24 hours covering how to do multi device support easily.


    This reply has been verified.
  • fechox
    Likes 0

    That would be awesome!, I look forward to it.

  • Sonar Systems admin
    Likes 1

    Just created another video tutorial, it will launch very soon :D


    This reply has been verified.

Login to reply