コード例 #1
0
                /// <summary>
                /// Attempts to capture the cursor at the given depth with the given HUD space. If drawInHudSpace
                /// is true, then the cursor will be drawn in the given space.
                /// </summary>
                public bool TryCaptureHudSpace(float depthSquared, HudSpaceDelegate GetHudSpaceFunc)
                {
                    if (GetCapturedHudSpaceFunc == null || depthSquared <= captureDepth)
                    {
                        captureDepth            = depthSquared;
                        GetCapturedHudSpaceFunc = GetHudSpaceFunc;

                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
コード例 #2
0
 /// <summary>
 /// Releases the cursor
 /// </summary>
 public void Release()
 {
     CapturedElement         = null;
     captureDepth            = 0f;
     GetCapturedHudSpaceFunc = null;
 }
コード例 #3
0
 /// <summary>
 /// Attempts to capture the cursor at the given depth with the given HUD space. If drawInHudSpace
 /// is true, then the cursor will be drawn in the given space.
 /// </summary>
 public void CaptureHudSpace(float depth, HudSpaceDelegate GetHudSpaceFunc) =>
 TryCaptureHudSpace(depth, GetHudSpaceFunc);
コード例 #4
0
 /// <summary>
 /// Returns true if the given HUD space is being captured by the cursor
 /// </summary>
 public bool IsCapturingSpace(HudSpaceDelegate GetHudSpaceFunc) =>
 Visible && GetCapturedHudSpaceFunc == GetHudSpaceFunc;