Exemplo n.º 1
0
    public void CalImage2Screen(DepthImagePos pos)
    {
        switch (pos)
        {
        case DepthImagePos.Invisible:
            imgWidth  = Screen.width / 10f;
            imgHeight = imgWidth * 3 / 4;

            baseX = 10f;
            baseY = Screen.height - imgHeight - 10;

            break;

        case DepthImagePos.RightMin:
            //RightMin
            imgWidth  = Screen.width / 6f;
            imgHeight = imgWidth * 3 / 4;

            baseX = Screen.width - imgWidth - 10f;
            baseY = Screen.height - imgHeight - 10f;

            break;

        case DepthImagePos.LeftMin:

            //leftMin;
            imgWidth  = Screen.width / 6f;
            imgHeight = imgWidth * 3 / 4;

            baseX = 10f;
            baseY = Screen.height - imgHeight - 10;


            break;

        case DepthImagePos.LeftMain:
            //leftMain;
            imgWidth  = Screen.width / 2f;
            imgHeight = imgWidth * 3 / 4;
            baseX     = (Screen.height - imgHeight) / 2;
            baseX     = Mathf.Clamp(baseX, 0f, 1600f);
            baseY     = baseX;

            break;

        default:
            //leftMain;
            imgWidth  = Screen.width / 2f;
            imgHeight = imgWidth * 3 / 4;
            baseX     = (Screen.height - imgHeight) / 2;
            baseX     = Mathf.Clamp(baseX, 0f, 1600f);
            baseY     = baseX;

            break;
        }
    }
    public void CalImage2Screen(DepthImagePos pos)
    {
        switch (pos)
        {
            case DepthImagePos.Invisible:
                imgWidth = Screen.width / 10f;
                imgHeight = imgWidth * 3 / 4;

                baseX = 10f;
                baseY = Screen.height - imgHeight - 10;

                break;

            case DepthImagePos.RightMin:
                //RightMin
                imgWidth = Screen.width / 6f;
                imgHeight = imgWidth * 3 / 4;

                baseX = Screen.width - imgWidth - 10f;
                baseY = Screen.height - imgHeight - 10f;

                break;
            case DepthImagePos.LeftMin:

                //leftMin;
                imgWidth = Screen.width / 6f;
                imgHeight = imgWidth * 3 / 4;

                baseX = 10f;
                baseY = Screen.height - imgHeight - 10;

                break;
            case DepthImagePos.LeftMain:
                //leftMain;
                imgWidth = Screen.width / 2f;
                imgHeight = imgWidth * 3 / 4;
                baseX = (Screen.height - imgHeight) / 2;
                baseX = Mathf.Clamp(baseX, 0f, 1600f);
                baseY = baseX;

                break;
            default:
                //leftMain;
                imgWidth = Screen.width / 2f;
                imgHeight = imgWidth * 3 / 4;
                baseX = (Screen.height - imgHeight) / 2;
                baseX = Mathf.Clamp(baseX, 0f, 1600f);
                baseY = baseX;

                break;
        }
    }