Exemplo n.º 1
0
        /**
         * Returns a scroll view object
         *
         * @param size view size
         * @param container parent object
         * @return scroll view object
         */

        protected virtual bool InitWithViewSize(CCSize size, CCNode container)
        {
            m_pContainer = container ?? new CCLayer();

            if (base.Init())
            {
                ViewSize = size;

                TouchEnabled        = true;
                m_pTouches          = new List <CCTouch>();
                m_pDelegate         = null;
                m_bBounceable       = true;
                m_bClippingToBounds = true;
                //m_pContainer->setContentSize(CCSizeZero);
                m_eDirection          = CCScrollViewDirection.Both;
                m_pContainer.Position = new CCPoint(0.0f, 0.0f);
                m_fTouchLength        = 0.0f;

                AddChild(m_pContainer);
                m_fMinScale = m_fMaxScale = 1.0f;

                return(true);
            }
            return(false);
        }
Exemplo n.º 2
0
        /**
         * Returns a scroll view object
         *
         * @param size view size
         * @param container parent object
         * @return scroll view object
         */
        public bool InitWithViewSize(CCSize size, CCNode container)
        {
            m_pContainer = container ?? new CCLayer();

            if (base.Init())
            {
                ViewSize = size;

                TouchEnabled = true;
                m_pTouches = new List<CCTouch>();
                m_pDelegate = null;
                m_bBounceable = true;
                m_bClippingToBounds = true;
                //m_pContainer->setContentSize(CCSizeZero);
                m_eDirection = CCScrollViewDirection.Both;
                m_pContainer.Position = new CCPoint(0.0f, 0.0f);
                m_fTouchLength = 0.0f;

                AddChild(m_pContainer);
                m_fMinScale = m_fMaxScale = 1.0f;

                return true;
            }
            return false;
        }