コード例 #1
0
    /// <summary>
    /// draw the sample GUI and error messages
    /// </summary>
    void OnGUI()
    {
        if (mCloudRecoBehaviour.CloudRecoInitialized && mImageTracker.TargetFinder.IsRequesting())
        {
            // draw the requesting texture
            DrawTexture(mRequestingTexture);
        }

        // draw error messages in case there were any
        ErrorMsg.Draw();
    }
コード例 #2
0
    /// <summary>
    /// Draws the UI when in scan mode.
    /// Automatically shows Help dialog when starting and after timeout.
    /// </summary>
    public void DrawUI(ImageTargetBuilder.FrameQuality frameQuality)
    {
        if (frameQuality != ImageTargetBuilder.FrameQuality.FRAME_QUALITY_NONE)
        {
            // draw the view finder UI...
            if (frameQuality == ImageTargetBuilder.FrameQuality.FRAME_QUALITY_MEDIUM || frameQuality == ImageTargetBuilder.FrameQuality.FRAME_QUALITY_HIGH)
            {
                // draw the view finder with green marks
                mUserInterface.DrawViewFinder(Color.green);
            }
            else
            {
                // draw the basic viewfinder with white marks and show the scanning message
                mUserInterface.DrawViewFinder(Color.white);
            }

            UserDefinedTargetBuildingUI.ButtonID buttonId = UserDefinedTargetBuildingUI.ButtonID.NONE_PRESSED;

            if (QCARRuntimeUtilities.IsLandscapeOrientation)
            {
                // Draws the Landscape UI for the Scanning Mode
                buttonId = mUserInterface.DrawScanningModeLandscapeUI();
            }
            else
            {
                // Draws the Portrait UI for the scanning mode
                buttonId = mUserInterface.DrawScanningModePortraitUI();
            }

            // Checks Button actions
            if (buttonId == UserDefinedTargetBuildingUI.ButtonID.CANCEL_PRESSED)
            {
                mStopScanningCallback();
            }
            else if (buttonId == UserDefinedTargetBuildingUI.ButtonID.BUILD_TARGET_PRESSED)
            {
                // check if the current frame has too low quality to create a good target
                if (frameQuality == ImageTargetBuilder.FrameQuality.FRAME_QUALITY_LOW)
                {
                    ErrorMsg.New("Low Quality Image", "The image has very little detail, please try another.",
                                 () => mUserInterface.ButtonPressed = true);
                }
                mStartBuildingCallback();
            }
        }

        // Draws possible error messages
        ErrorMsg.Draw();
    }
コード例 #3
0
 /// <summary>
 /// draw the sample GUI and error messages
 /// </summary>
 void OnGUI()
 {
     // draw error messages in case there were any
     ErrorMsg.Draw();
 }