Exemplo n.º 1
0
        public override void TouchesMoved(List<cocos2d.CCTouch> touches, cocos2d.CCEvent event_)
        {
            CCSize s = CCDirector.SharedDirector.WinSize;

            var it = touches.FirstOrDefault();
            CCTouch touch = (CCTouch)(it);
            CCPoint start = touch.LocationInView;
            start = CCDirector.SharedDirector.ConvertToGl(start);

            CCPoint diff = new CCPoint(s.Width / 2 - start.X, s.Height / 2 - start.Y);
            diff = CCPointExtension.Normalize(diff);

            CCLayerGradient gradient = (CCLayerGradient)GetChildByTag(1);
            gradient.Vector = diff;
        }
Exemplo n.º 2
0
        public override void ccTouchesMoved(List<cocos2d.CCTouch> touches, cocos2d.CCEvent event_)
        {
            CCSize s = CCDirector.sharedDirector().getWinSize();

            var it = touches.FirstOrDefault();
            CCTouch touch = (CCTouch)(it);
            CCPoint start = touch.locationInView(touch.view());
            start = CCDirector.sharedDirector().convertToGL(start);

            CCPoint diff = new CCPoint(s.width / 2 - start.x, s.height / 2 - start.y);
            diff = CCPointExtension.ccpNormalize(diff);

            CCLayerGradient gradient = (CCLayerGradient)getChildByTag(1);
            gradient.Vector = diff;
        }
Exemplo n.º 3
0
 public override void ccTouchesEnded(List<cocos2d.CCTouch> touches, cocos2d.CCEvent event_)
 {
     base.ccTouchesEnded(touches, event_);
 }
 public CCBMFontConfiguration(cocos2d.CCBMFontConfiguration fnt)
 {
     AtlasName = fnt.AtlasName;
     m_nCommonHeight = fnt.m_nCommonHeight;
     m_tPadding.bottom = fnt.m_tPadding.bottom;
     m_tPadding.top = fnt.m_tPadding.top;
     m_tPadding.left = fnt.m_tPadding.left;
     m_tPadding.right = fnt.m_tPadding.right;
     foreach (int key in fnt.m_pKerningDictionary.Keys)
     {
         tKerningHashElement tk;
         tk.key = fnt.m_pKerningDictionary[key].key;
         tk.amount = fnt.m_pKerningDictionary[key].amount;
         m_pKerningDictionary[key] = tk;
     }
     foreach (int key in fnt.m_pFontDefDictionary.Keys)
     {
         ccBMFontDef tk = new ccBMFontDef();
         tk.charID = fnt.m_pFontDefDictionary[key].charID;
         tk.rect.Origin.X = fnt.m_pFontDefDictionary[key].rect.Origin.X;
         tk.rect.Origin.Y = fnt.m_pFontDefDictionary[key].rect.Origin.Y;
         tk.rect.Size.Width = fnt.m_pFontDefDictionary[key].rect.Size.Width;
         tk.rect.Size.Height = fnt.m_pFontDefDictionary[key].rect.Size.Height;
         tk.xAdvance = fnt.m_pFontDefDictionary[key].xAdvance;
         tk.xOffset = fnt.m_pFontDefDictionary[key].xOffset;
         tk.yOffset = fnt.m_pFontDefDictionary[key].yOffset;
         m_pFontDefDictionary[key] = tk;
     }
 }