本文整理汇总了C#中TouchCollection.FindById方法的典型用法代码示例。如果您正苦于以下问题:C# TouchCollection.FindById方法的具体用法?C# TouchCollection.FindById怎么用?C# TouchCollection.FindById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TouchCollection
的用法示例。
在下文中一共展示了TouchCollection.FindById方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WorksWhenConstructedEmpty
public void WorksWhenConstructedEmpty()
{
TouchCollection collection = new TouchCollection();
Assert.AreEqual(0, collection.Count);
foreach (var touch in collection)
Assert.Fail("Shouldn't have any touches in an empty collection");
Assert.AreEqual(-1, collection.IndexOf(new TouchLocation()));
TouchLocation touchLocation;
Assert.False(collection.FindById(1, out touchLocation));
}
示例2: ReadInput
public void ReadInput()
{
var oldCollection = _touches;
_touches = TouchPanel.GetState();
_releasedTouches.Clear();
_handledInputs.Clear();
TouchLocation ignore;
foreach (var oldTouch in oldCollection)
{
if (!_touches.FindById(oldTouch.Id, out ignore))
{
_releasedTouches[oldTouch.Id] = new TouchLocation(oldTouch.Id, TouchLocationState.Released,
oldTouch.Position, oldTouch.State, oldTouch.Position);
}
}
}
示例3: TouchPosition
private Vector2? TouchPosition(TouchCollection touchLocationState)
{
TouchLocation touchLocation;
if (touchLocationState.FindById(TouchID, out touchLocation))
{
return touchLocation.Position;
}
return null;
}