本文整理汇总了C#中CCPoint.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# CCPoint.Equals方法的具体用法?C# CCPoint.Equals怎么用?C# CCPoint.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCPoint
的用法示例。
在下文中一共展示了CCPoint.Equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyLayerOffset
CCPoint ApplyLayerOffset(CCPoint tileCoord)
{
CCPoint ret = CCPoint.Zero;
switch (LayerOrientation)
{
case CCTMXOrientation.Ortho:
ret = new CCPoint(tileCoord.X * MapTileSize.Width, -tileCoord.Y * MapTileSize.Height);
break;
case CCTMXOrientation.Iso:
ret = new CCPoint((MapTileSize.Width / 2) * (tileCoord.X - tileCoord.Y),
(MapTileSize.Height / 2) * (-tileCoord.X - tileCoord.Y));
break;
case CCTMXOrientation.Hex:
Debug.Assert(tileCoord.Equals(CCPoint.Zero), "offset for hexagonal map not implemented yet");
break;
}
return ret;
}
示例2: LayerOffset
CCPoint LayerOffset(CCPoint offsetInTileCoords)
{
CCPoint offsetInNodespace = CCPoint.Zero;
switch (MapType)
{
case CCTileMapType.Ortho:
offsetInNodespace = new CCPoint(offsetInTileCoords.X * TileTexelSize.Width, -offsetInTileCoords.Y * TileTexelSize.Height);
break;
case CCTileMapType.Iso:
offsetInNodespace = new CCPoint((TileTexelSize.Width / 2) * (offsetInTileCoords.X - offsetInTileCoords.Y),
(TileTexelSize.Height / 2) * (-offsetInTileCoords.X - offsetInTileCoords.Y));
break;
case CCTileMapType.Hex:
Debug.Assert(offsetInTileCoords.Equals(CCPoint.Zero), "offset for hexagonal map not implemented yet");
break;
}
offsetInNodespace *= CCTileMapLayer.DefaultTexelToContentSizeRatios;
return offsetInNodespace;
}
示例3: setPosition
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;
}
}