FairyGUI.Container.HitTest C# (CSharp) Method

HitTest() public method

public HitTest ( Vector2 stagePoint, bool forTouch ) : DisplayObject
stagePoint Vector2
forTouch bool
return DisplayObject
        public DisplayObject HitTest(Vector2 stagePoint, bool forTouch)
        {
            if (StageCamera.main == null)
                return null;

            HitTestContext.screenPoint = new Vector2(stagePoint.x, Screen.height - stagePoint.y);
            HitTestContext.worldPoint = StageCamera.main.ScreenToWorldPoint(HitTestContext.screenPoint);
            HitTestContext.direction = Vector3.back;
            HitTestContext.forTouch = forTouch;

            DisplayObject ret = HitTest();
            if (ret != null)
                return ret;
            else if (this is Stage)
                return this;
            else
                return null;
        }

Same methods

Container::HitTest ( ) : DisplayObject

Usage Example

Example #1
0
 static int HitTest(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         FairyGUI.Container  obj  = (FairyGUI.Container)ToLua.CheckObject <FairyGUI.Container>(L, 1);
         UnityEngine.Vector2 arg0 = ToLua.ToVector2(L, 2);
         bool arg1 = LuaDLL.luaL_checkboolean(L, 3);
         FairyGUI.DisplayObject o = obj.HitTest(arg0, arg1);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
All Usage Examples Of FairyGUI.Container::HitTest