예제 #1
0
 public void setPosition(CCPoint pos)
 {
     if (!pos.Equals(m_position))
     {
         m_position           = pos;
         m_positionInPixels.X = pos.X * Director.SharedDirector.ContentScaleFactor;
         m_positionInPixels.Y = pos.Y * Director.SharedDirector.ContentScaleFactor;
         m_bDirty             = true;
     }
 }
예제 #2
0
 private CCPoint CalculateLayerOffset(CCPoint pos)
 {
     CCPoint ret = CCPoint.Zero;
     switch (m_uLayerOrientation)
     {
         case CCTMXOrientation.CCTMXOrientationOrtho:
             ret = new CCPoint(pos.X * m_tMapTileSize.Width, -pos.Y * m_tMapTileSize.Height);
             break;
         case CCTMXOrientation.CCTMXOrientationIso:
             ret = new CCPoint((m_tMapTileSize.Width / 2) * (pos.X - pos.Y),
                               (m_tMapTileSize.Height / 2) * (-pos.X - pos.Y));
             break;
         case CCTMXOrientation.CCTMXOrientationHex:
             Debug.Assert(pos.Equals(CCPoint.Zero), "offset for hexagonal map not implemented yet");
             break;
     }
     return ret;
 }