Exemple #1
0
        public void TouchGetLocalPosition()
        {
            tlog.Debug(tag, $"TouchGetLocalPosition START");
            Touch   a1 = new Touch();
            Vector2 b1 = a1.GetLocalPosition(2);

            a1.Dispose();

            tlog.Debug(tag, $"TouchGetLocalPosition END (OK)");
            Assert.Pass("TouchGetLocalPosition");
        }
 private void OnClickedInternal(ClickedEventArgs eventArgs, Touch touch)
 {
     // If GrabTouchAfterLeave is true, Up will result in Finished rather than Interrupted even if it is out of the button area.
     // So, it is necessary to check whether it is Up in the button area.
     if (GrabTouchAfterLeave == true)
     {
         Vector2 localPosition = touch.GetLocalPosition(0);
         if ((localPosition != null && Size != null &&
              0 <= localPosition.X && localPosition.X <= Size.Width &&
              0 <= localPosition.Y && localPosition.Y <= Size.Height) == false)
         {
             return;
         }
     }
     OnClickedInternal(eventArgs);
 }
Exemple #3
0
        public void TouchGetLocalPosition()
        {
            tlog.Debug(tag, $"TouchGetLocalPosition START");

            var testingTarget = new Touch();

            Assert.IsNotNull(testingTarget, "Can't create success object Touch");
            Assert.IsInstanceOf <Touch>(testingTarget, "Should be an instance of Touch type.");

            try
            {
                testingTarget.GetLocalPosition(0);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                testingTarget.Dispose();
                tlog.Debug(tag, $"TouchGetLocalPosition END (OK)");
                Assert.Pass("Caught Exception : Passed!");
            }
        }