コード例 #1
0
        public static CCPointObject pointWithCCPoint(CCPoint ratio, CCPoint offset)
        {
            CCPointObject cCPointObject = new CCPointObject();

            cCPointObject.initWithCCPoint(ratio, offset);
            return(cCPointObject);
        }
コード例 #2
0
 public static CCPointObject pointWithCCPoint(CCPoint ratio, CCPoint offset)
 {
     CCPointObject pRet = new CCPointObject();
     pRet.initWithCCPoint(ratio, offset);
     //pRet->autorelease();
     return pRet;
 }
コード例 #3
0
        public static CCPointObject pointWithCCPoint(CCPoint ratio, CCPoint offset)
        {
            CCPointObject pRet = new CCPointObject();

            pRet.initWithCCPoint(ratio, offset);
            //pRet->autorelease();
            return(pRet);
        }
コード例 #4
0
        public virtual void addChild(CCNode child, uint z, CCPoint parallaxRatio, CCPoint positionOffset)
        {
            CCPointObject.pointWithCCPoint(parallaxRatio, positionOffset).Child = child;
            CCPoint mTPosition = this.m_tPosition;

            mTPosition.x   = mTPosition.x * parallaxRatio.x + positionOffset.x;
            mTPosition.y   = mTPosition.y * parallaxRatio.y + positionOffset.y;
            child.position = mTPosition;
            base.addChild(child, (int)z, child.tag);
        }
コード例 #5
0
 public virtual void removeChild(CCNode child, bool cleanup)
 {
     for (int i = 0; i < m_pParallaxArray.Count; i++)
     {
         CCPointObject point = (CCPointObject)m_pParallaxArray[i];
         if (point.Child == child)
         {
             //ccCArray.ccArrayRemoveObjectAtIndex(m_pParallaxArray, i);
             break;
         }
     }
     base.removeChild(child, cleanup);
 }
コード例 #6
0
ファイル: CCParallaxNode.cs プロジェクト: HarkDev/cocos2d-xna
        public virtual void AddChild(CCNode child, int z, CCPoint ratio, CCPoint offset)
        {
            Debug.Assert(child != null, "Argument must be non-nil");
            CCPointObject obj = new CCPointObject(ratio, offset);
            obj.Child = child;

            m_pParallaxArray.Add(obj);

            CCPoint pos = m_tPosition;
            pos.X = pos.X * ratio.X + offset.X;
            pos.Y = pos.Y * ratio.Y + offset.Y;
            child.Position = pos;

            base.AddChild(child, z, child.Tag);
        }
コード例 #7
0
        public virtual void addChild(CCNode child, UInt32 z, CCPoint parallaxRatio, CCPoint positionOffset)
        {
            Debug.Assert(child != null, "Argument must be non-nil");
            CCPointObject obj = CCPointObject.pointWithCCPoint(parallaxRatio, positionOffset);

            obj.Child = child;
            //ccCArray.ccArrayAppendObjectWithResize(m_pParallaxArray, (CCObject)obj);

            CCPoint pos = m_tPosition;

            pos.x          = pos.x * parallaxRatio.x + positionOffset.x;
            pos.y          = pos.y * parallaxRatio.y + positionOffset.y;
            child.position = pos;

            base.addChild(child, (int)z, child.tag);
        }
コード例 #8
0
        public virtual new void visit()
        {
            CCPoint cCPoint = this.absolutePosition();

            if (!CCPoint.CCPointEqualToPoint(cCPoint, this.m_tLastPosition))
            {
                for (int i = 0; i < this.m_pParallaxArray.Count; i++)
                {
                    CCPointObject item   = this.m_pParallaxArray[i];
                    float         ratio  = -cCPoint.x + cCPoint.x * item.Ratio.x + item.Offset.x;
                    float         single = -cCPoint.y + cCPoint.y * item.Ratio.y + item.Offset.y;
                    item.Child.position = new CCPoint(ratio, single);
                }
                this.m_tLastPosition = cCPoint;
            }
            base.visit();
        }
コード例 #9
0
        public virtual void visit()
        {
            //	CCPoint pos = position_;
            //	CCPoint	pos = [self convertToWorldSpace:CCPointZero];
            CCPoint pos = this.absolutePosition();

            if (!CCPoint.CCPointEqualToPoint(pos, m_tLastPosition))
            {
                for (int i = 0; i < m_pParallaxArray.Count; i++)
                {
                    CCPointObject point = (CCPointObject)(m_pParallaxArray[i]);
                    float         x     = -pos.x + pos.x * point.Ratio.x + point.Offset.x;
                    float         y     = -pos.y + pos.y * point.Ratio.y + point.Offset.y;
                    point.Child.position = new CCPoint(x, y);
                }
                m_tLastPosition = pos;
            }
            base.visit();
        }