• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ScreenOrientation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ScreenOrientation的典型用法代码示例。如果您正苦于以下问题:C# ScreenOrientation类的具体用法?C# ScreenOrientation怎么用?C# ScreenOrientation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ScreenOrientation类属于命名空间,在下文中一共展示了ScreenOrientation类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ScreenUtils

 private ScreenUtils(int width, int height)
 {
     this.orientation = ScreenOrientation.Portrait;
     this.width = width;
     this.height = height;
     this.max_width = (width > height) ? width : height;
 }
开发者ID:g360230,项目名称:quran-phone,代码行数:7,代码来源:ScreenUtils.cs


示例2: RevMobIosBanner

	public RevMobIosBanner(string placementId, ScreenOrientation[] orientations, float x, float y, float width, float height) {
		this.x = x;
		this.y = y;
		this.width = width;
		this.height = height;
		this.orientations = orientations;
		this.placementId = placementId;
	}
开发者ID:uptopgames,项目名称:Minesweeper,代码行数:8,代码来源:RevMobIosBanner.cs


示例3: getOrthographicSize

    /// <summary>
    /// Determine size of the orthographic camera based on screen orientation.
    /// </summary>
    /// <returns>
    /// The orthographic camera size.
    /// </returns>
    /// <param name='orientation'>
    /// Screen orientation
    /// </param>
    private static float getOrthographicSize(ScreenOrientation orientation)
    {
        if (orientation == ScreenOrientation.Portrait || orientation == ScreenOrientation.PortraitUpsideDown)
            return 1.0f;

        if (Screen.width < Screen.height)
            return ((float)Screen.width)/((float)Screen.height);
        else
            return ((float)Screen.height)/((float)Screen.width);
    }
开发者ID:Bizounours,项目名称:metaioSDK,代码行数:19,代码来源:metaioDeviceCamera.cs


示例4: OrientationChanged

	void OrientationChanged(ScreenOrientation newOrientation)
	{
//		Debug.LogWarning("new orientation: " + newOrientation + " material: " + materialIndex);
		if (newOrientation == ScreenOrientation.Landscape) {
			ChangeMaterial(materialLandscape, materialIndex);
		}
		else if (newOrientation == ScreenOrientation.Portrait) {
			ChangeMaterial(materialPortrait, materialIndex);
		}
	}
开发者ID:JulyMars,项目名称:frozen_free_fall,代码行数:10,代码来源:OrientationMaterialChanger.cs


示例5: ActionOnOrientationChanged

	public void ActionOnOrientationChanged(ScreenOrientation newOrientation) 
	{
		if(newOrientation == ScreenOrientation.Landscape)
		{
			transform.localPosition = positionLandscape;
		}
		else
		{
			transform.localPosition = positionPortrait;
		}
	}
开发者ID:JulyMars,项目名称:frozen_free_fall,代码行数:11,代码来源:ObjectiveHintController.cs


示例6:

		public MenüSate(StateManager managerRef) // Constructor
		{
			#if UNITY_ANDROID || UNITY_IPHONE
			Screen.orientation = ScreenOrientation.AutoRotation;
			saveOri = Screen.orientation;
			#endif

			manager = managerRef;

			Application.LoadLevel ("Menue");
		}
开发者ID:Keyj1n,项目名称:BattlePong,代码行数:11,代码来源:MenüState.cs


示例7: UpdateScale

	void UpdateScale(ScreenOrientation orientation)
	{	
		if (screenWidth == Mathf.Max(Screen.width, Screen.height)) {
			return;
		}
		
		screenWidth = Mathf.Max(Screen.width, Screen.height);
		
		float myScaleFactor = screenWidth / referenceWidth;
		cachedTransform.localScale = originalScale * Mathf.Clamp(dpiScaleFactor / myScaleFactor, minScaleFactor, maxScaleFactor);
		//Debug.LogWarning("New Scale: " + dpiScaleFactor / myScaleFactor);
	}
开发者ID:JulyMars,项目名称:frozen_free_fall,代码行数:12,代码来源:ScaleUpByDpi.cs


示例8: SetRect

		public void SetRect(Rect screenRect, Rect rect, Rect landscapeRect, ScreenOrientation orientation) {

			this.screenRect = screenRect;
			this.rect = rect;
			this.orientation = orientation;
			
			this.sprite = Resources.Load<Sprite>("UI.Windows/DevicePreview/Images/" + this.GetMainImage());

			if (this.sprite != null) {
				/*
				if (orientation == ScreenOrientation.Landscape) {
					
					var textureWidth = this.sprite.texture.width;
					var textureHeight = this.sprite.texture.height;
					var border = this.sprite.border;
					var offsetRect = new Vector4(border.x / textureWidth * this.rect.width, border.y / textureHeight * this.rect.height, border.z / textureWidth * this.rect.width, border.w / textureHeight * this.rect.height);

					this.landscapeRect = new Rect(this.rect.x - offsetRect.x + offsetRect.z * 0.5f,
										          this.rect.y - offsetRect.y + offsetRect.w * 0.5f,
										          this.rect.width + offsetRect.z * 0.5f + offsetRect.z,
										          this.rect.height + offsetRect.w * 0.5f + offsetRect.w);

				} else {

					this.landscapeRect = landscapeRect;

				}*/

				if (orientation == ScreenOrientation.Landscape) {

					var offsetRect = this.sprite.border;
					this.deviceRect = new Rect(this.rect.x - offsetRect.x + offsetRect.z * 0.5f,
					                              this.rect.y - offsetRect.y + offsetRect.w * 0.5f,
					                              this.rect.width + offsetRect.z * 0.5f + offsetRect.z,
					                              this.rect.height + offsetRect.w * 0.5f + offsetRect.w);

				} else {

					this.rect = landscapeRect;
					var offsetRect = this.sprite.border;
					this.deviceRect = new Rect(this.rect.x - offsetRect.x + offsetRect.z * 0.5f,
					                           this.rect.y - offsetRect.y + offsetRect.w * 0.5f,
					                           this.rect.width + offsetRect.z * 0.5f + offsetRect.z,
					                           this.rect.height + offsetRect.w * 0.5f + offsetRect.w
					                           );

				}

			}

		}
开发者ID:RuFengLau,项目名称:Unity3d.UI.Windows,代码行数:51,代码来源:DeviceOutputBase.cs


示例9: Awake

	// Use this for initialization
	void Awake () {
		
		float Screenheight = (float)_targetCam.orthographicSize* 2.0f; 
		float Screenwidth = Screenheight * Screen.width / Screen.height;
		height = Screenheight ;
		width = Screenwidth;
		this.transform.localPosition = new Vector3(0,0,-0.8f);

		#if UNITY_EDITOR
		transform.localEulerAngles = new Vector3(90,180,0);
		transform.localScale = new Vector3(width/10, 1.0f, height/10);
		#elif UNITY_WEBPLAYER
		transform.localEulerAngles = new Vector3(90,180,0);
		transform.localScale = new Vector3(width/10, 1.0f, height/10);
		#endif

		orientation = Screen.orientation;

		Screen.sleepTimeout = SleepTimeout.NeverSleep;
		if (Screen.orientation == ScreenOrientation.Portrait||
		    Screen.orientation == ScreenOrientation.PortraitUpsideDown) {

			#if UNITY_ANDROID
			transform.localEulerAngles = new Vector3(0,270,90);
			transform.localScale = new Vector3(height/10, 1.0f, width/10);
			#elif UNITY_IOS
			if( Screen.orientation == ScreenOrientation.PortraitUpsideDown)
			{
				transform.localEulerAngles = new Vector3(0,270,90);
			}
			else
			{
				transform.localEulerAngles = new Vector3(0,90,270);
			}
			transform.localScale = new Vector3(-1*height/10, 1.0f, width/10);
			#endif
		} else if (Screen.orientation == ScreenOrientation.Landscape) {
			#if UNITY_ANDROID
			transform.localEulerAngles = new Vector3(90,180,0);
			transform.localScale = new Vector3(width/10, 1.0f, height/10);
			#elif UNITY_IOS
			transform.localEulerAngles = new Vector3(-90,0,0);
			transform.localScale = new Vector3(-1*width/10, 1.0f, height/10);
			
			#endif
		}
	}
开发者ID:flicknewb,项目名称:ARG-Zombies-Scaffolding,代码行数:48,代码来源:CameraPlaneController.cs


示例10: SetResolution

			public bool SetResolution(int width, int height, float ppi, ScreenOrientation orientation, IDeviceOutput deviceOutput) {

				var result = false;

				this.orientation = orientation;
				this.deviceOutput = deviceOutput;

				this.ppi = ppi;
				this.currentWidth = width;
				this.currentHeight = height;
				
				this.tempScreenshot = new Texture2D(width, height, TextureFormat.RGB24, false);

				this.tempRenderTexture = new RenderTexture(width, height, 24, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Default);
				/*
				if (this.previewCamera == null) {

					var go = new GameObject("__TempCamera");
					this.previewCamera = go.AddComponent<DevicePreviewCamera>();

				}

				this.previewCamera.Initialize(this.tempRenderTexture, () => {

					this.root.Repaint();
					GameObject.DestroyImmediate(this.previewCamera.gameObject);

				});*/

				var size = new Vector2(this.width, this.height);
				var imageSize = new Vector2(this.currentWidth, this.currentHeight);
				var factor = this.GetFactor(imageSize, size);
				var k = Screen.dpi / this.ppi;

				if (factor / k < 1f) {

					result = true;

				}

				this.isActive = true;

				this.Update();

				return result;

			}
开发者ID:RuFengLau,项目名称:Unity3d.UI.Windows,代码行数:47,代码来源:DevicePreviewWindow.cs


示例11: GetProjectionGL

    // Returns the QCAR projection matrix
    public static Matrix4x4 GetProjectionGL(float nearPlane, float farPlane, ScreenOrientation screenOrientation)
    {
        float[] projMatrixArray = new float[16];
        IntPtr projMatrixPtr = Marshal.AllocHGlobal(
                    Marshal.SizeOf(typeof(float)) * projMatrixArray.Length);

        QCARWrapper.Instance.GetProjectionGL(nearPlane, farPlane, projMatrixPtr,
                    (int)screenOrientation);

        Marshal.Copy(projMatrixPtr, projMatrixArray, 0, projMatrixArray.Length);
        Matrix4x4 projMatrix = Matrix4x4.identity;
        for (int i = 0; i < 16; i++)
            projMatrix[i] = projMatrixArray[i];

        Marshal.FreeHGlobal(projMatrixPtr);

        return projMatrix;
    }
开发者ID:JSungMin,项目名称:AugmentedRealityExample,代码行数:19,代码来源:QCARUnityImpl.cs


示例12: ResetOrientation

    /// <summary>
    ///  Method to approraitiatly rotate the device and screen orientation
    /// </summary>
    private void ResetOrientation()
    {
        Vector3 cardboardRot = Cardboard.SDK.transform.GetChild (0).rotation.eulerAngles;
        if ( (cardboardRot.z + ScreenRotationThreshold > 360f) || (0f > cardboardRot.z - ScreenRotationThreshold) ) {
            currOrient = ScreenOrientation.LandscapeLeft;
        } else if ( (cardboardRot.z - ScreenRotationThreshold < 270f) && (270f < cardboardRot.z + ScreenRotationThreshold) ) {
            currOrient = ScreenOrientation.Portrait;
        } else if ( (cardboardRot.z - ScreenRotationThreshold < 90f) && (90f < cardboardRot.z + ScreenRotationThreshold) ) {
            currOrient = ScreenOrientation.PortraitUpsideDown;
        } else if ( (cardboardRot.z - ScreenRotationThreshold < 180f) && (180f < cardboardRot.z + ScreenRotationThreshold) ) {
            currOrient = ScreenOrientation.LandscapeRight;
        }

        if (NaviMobileManager.Instance.canUserResetOrientation)
            Screen.orientation = currOrient;

        NaviMobileManager.Instance.SendCurrentSize ();
    }
开发者ID:vmohan7,项目名称:Navi,代码行数:21,代码来源:GyroManager.cs


示例13: SetRect

		public void SetRect(Rect groupRect, Rect screenRect, Rect rect, Rect landscapeRect, ScreenOrientation orientation) {

			this.groupRect = groupRect;
			this.screenRect = screenRect;
			this.rect = rect;
			this.orientation = orientation;

			if (this.sprite == null) {
				
				var filepath = "UI.Windows/DevicePreview/Images/" + this.GetMainImage();
				this.sprite = UnityEditor.UI.Windows.CoreUtilities.Load<Sprite>(filepath);

			}

			if (this.sprite != null) {

				var imageSize = this.sprite.rect.size;
				var offsetRect = this.sprite.border;
				var offset = this.GetOffset();

				var cx = (imageSize.x - offsetRect.x - offsetRect.z) * 0.5f + offsetRect.x + offset.x;
				var cy = (imageSize.y - offsetRect.y - offsetRect.w) * 0.5f + offsetRect.y + offset.y;
				
				offset = new Vector2((cx - imageSize.x * 0.5f) * 0.5f, (imageSize.y * 0.5f - cy) * 0.5f);
				this.rect.center -= offset;

				if (orientation == ScreenOrientation.Portrait) {

					var imageContentRect = new Rect(offsetRect.x, offsetRect.y, imageSize.x - offsetRect.z - offsetRect.x, imageSize.y - offsetRect.w - offsetRect.y);
					var k = this.rect.height / imageContentRect.height;
					this.deviceRect = new Rect(this.groupRect.x + this.rect.center.x - imageSize.x * 0.5f * k, this.groupRect.y + this.rect.center.y - imageSize.y * 0.5f * k, imageSize.x * k, imageSize.y * k);

				} else {

					var imageContentRect = new Rect(offsetRect.y, offsetRect.x, imageSize.y - offsetRect.w - offsetRect.y, imageSize.x - offsetRect.z - offsetRect.x);
					var k = this.rect.width / imageContentRect.width;
					this.deviceRect = new Rect(this.groupRect.y + this.rect.center.x - imageSize.x * 0.5f * k, -this.groupRect.x + this.rect.center.y - imageSize.y * 0.5f * k, imageSize.x * k, imageSize.y * k);

				}

			}

		}
开发者ID:Cyberbanan,项目名称:Unity3d.UI.Windows,代码行数:43,代码来源:DeviceOutputBase.cs


示例14: Update

    // Process the camera image and tracking data for this frame
    public void Update(ScreenOrientation counterRotation)
    {
        // enable "fake tracking" if running in the free editor version
        // that does not support native plugins
        if (!QCARRuntimeUtilities.IsQCAREnabled())
        {
            UpdateTrackablesEditor();
            return;
        }

        // Prepare the camera image container
        UpdateImageContainer();

        if (QCARRuntimeUtilities.IsPlayMode())
        {
            CameraDeviceImpl cameraDeviceImpl = (CameraDeviceImpl)CameraDevice.Instance;
            if (cameraDeviceImpl.WebCam.DidUpdateThisFrame)
            {
                InjectCameraFrame();
            }
        }

        // Draw the video background or update the video texture
        // Also retrieve registered camera images for this frame
        QCARWrapper.Instance.UpdateQCAR(mImageHeaderData, mNumImageHeaders,
            mDrawVideobackground ? 0 : 1,
            mLastProcessedFrameStatePtr, (int)counterRotation);

        FrameState frameState = (FrameState)Marshal.PtrToStructure(mLastProcessedFrameStatePtr, typeof(FrameState));
        // Reinitialize the trackable data container if required:
        InitializeTrackableContainer(frameState.numTrackableResults);

        // Handle the camera image data
        UpdateCameraFrame();

        // Handle the trackable data
        UpdateTrackers(frameState);

        if (QCARRuntimeUtilities.IsPlayMode())
        {
            // read out the index of the last processed frame
            CameraDeviceImpl cameraDeviceImpl = (CameraDeviceImpl)CameraDevice.Instance;
            cameraDeviceImpl.WebCam.SetFrameIndex(frameState.frameIndex);
        }
    }
开发者ID:negimochi,项目名称:vuforia_test,代码行数:46,代码来源:QCARManagerImpl.cs


示例15: SetOrientation

 public static void SetOrientation(this IWebDriver driver, ScreenOrientation orientation)
 {
     ((IRotatable) driver).Orientation = orientation;
 }
开发者ID:tokarthik,项目名称:ProtoTest.Golem,代码行数:4,代码来源:WebDriverExtensions.cs


示例16: Presenter

 public Presenter(string path, string layoutPath = "master", ScreenOrientation orientation = ScreenOrientation.Unknown)
 {
     this.path = path;
     this.layoutPath = layoutPath;
     this.orientation = orientation;
 }
开发者ID:cgarciae,项目名称:umvc,代码行数:6,代码来源:Metadata.cs


示例17: FScreen

    public FScreen(FutileParams futileParams)
    {
        _futileParams = futileParams;
        #if UNITY_IPHONE || UNITY_ANDROID
        TouchScreenKeyboard.autorotateToLandscapeLeft = false;
        TouchScreenKeyboard.autorotateToLandscapeRight = false;
        TouchScreenKeyboard.autorotateToPortrait = false;
        TouchScreenKeyboard.autorotateToPortraitUpsideDown = false;
        #endif

        //Non-mobile unity always defaults to portrait for some reason, so fix this manually
        if(Screen.height > Screen.width)
        {
            _currentOrientation = ScreenOrientation.Portrait;
        }
        else
        {
            _currentOrientation = ScreenOrientation.LandscapeLeft;
        }

        //get the correct orientation if we're on a mobile platform
        #if !UNITY_EDITOR && (UNITY_IPHONE || UNITY_ANDROID)
            _currentOrientation = Screen.orientation;
        #endif

        //special "single orientation" mode
        if(_futileParams.singleOrientation != ScreenOrientation.Unknown)
        {
            _currentOrientation = _futileParams.singleOrientation;
        }
        else //if we're not in a supported orientation, put us in one!
        {
            if(_currentOrientation == ScreenOrientation.LandscapeLeft && !_futileParams.supportsLandscapeLeft)
            {
                if(_futileParams.supportsLandscapeRight) _currentOrientation = ScreenOrientation.LandscapeRight;
                else if(_futileParams.supportsPortrait) _currentOrientation = ScreenOrientation.Portrait;
                else if(_futileParams.supportsPortraitUpsideDown) _currentOrientation = ScreenOrientation.PortraitUpsideDown;
            }
            else if(_currentOrientation == ScreenOrientation.LandscapeRight && !_futileParams.supportsLandscapeRight)
            {
                if(_futileParams.supportsLandscapeLeft) _currentOrientation = ScreenOrientation.LandscapeLeft;
                else if(_futileParams.supportsPortrait) _currentOrientation = ScreenOrientation.Portrait;
                else if(_futileParams.supportsPortraitUpsideDown) _currentOrientation = ScreenOrientation.PortraitUpsideDown;
            }
            else if(_currentOrientation == ScreenOrientation.Portrait && !_futileParams.supportsPortrait)
            {
                if(_futileParams.supportsPortraitUpsideDown) _currentOrientation = ScreenOrientation.PortraitUpsideDown;
                else if(_futileParams.supportsLandscapeLeft) _currentOrientation = ScreenOrientation.LandscapeLeft;
                else if(_futileParams.supportsLandscapeRight) _currentOrientation = ScreenOrientation.LandscapeRight;
            }
            else if(_currentOrientation == ScreenOrientation.PortraitUpsideDown && !_futileParams.supportsPortraitUpsideDown)
            {
                if(_futileParams.supportsPortrait) _currentOrientation = ScreenOrientation.Portrait;
                else if(_futileParams.supportsLandscapeLeft) _currentOrientation = ScreenOrientation.LandscapeLeft;
                else if(_futileParams.supportsLandscapeRight) _currentOrientation = ScreenOrientation.LandscapeRight;
            }
        }

        Screen.orientation = _currentOrientation;

        _screenLongLength = Math.Max(Screen.height, Screen.width);
        _screenShortLength = Math.Min(Screen.height, Screen.width);

        if(_currentOrientation == ScreenOrientation.Portrait || _currentOrientation == ScreenOrientation.PortraitUpsideDown)
        {
            pixelWidth = _screenShortLength;
            pixelHeight = _screenLongLength;
        }
        else //landscape
        {
            pixelWidth = _screenLongLength;
            pixelHeight = _screenShortLength;
        }

        //get the resolution level - the one we're closest to WITHOUT going over, price is right rules :)
        _resLevel = null;

        foreach(FResolutionLevel resLevel in _futileParams.resLevels)
        {
            if(_screenLongLength <= resLevel.maxLength) //we've found our resLevel
            {
                _resLevel = resLevel;
                break;
            }
        }

        //if we couldn't find a res level, it means the screen is bigger than the biggest one, so just choose the biggest
        if(_resLevel == null)
        {
            _resLevel = _futileParams.resLevels.GetLastObject();
            if(_resLevel == null)
            {
                throw new Exception("You must add at least one FResolutionLevel!");
            }
        }

        Futile.resourceSuffix = _resLevel.resourceSuffix;

        //this is what helps us figure out the display scale if we're not at a specific resolution level
        //it's relative to the next highest resolution level
//.........这里部分代码省略.........
开发者ID:HaKDMoDz,项目名称:awayteam,代码行数:101,代码来源:FScreen.cs


示例18: SwitchOrientation

    public void SwitchOrientation(ScreenOrientation newOrientation)
    {
        Debug.Log("Futile: Orientation changed to " + newOrientation);

        if(_futileParams.singleOrientation != ScreenOrientation.Unknown) //if we're in single orientation mode, just broadcast the change, don't actually change anything
        {
            _currentOrientation = newOrientation;
            if(SignalOrientationChange != null) SignalOrientationChange();
        }
        else
        {
            Screen.orientation = newOrientation;
            _currentOrientation = newOrientation;

            UpdateScreenDimensions();

            Debug.Log ("Orientation switched to " + _currentOrientation + " screen is now: " + pixelWidth+"x"+pixelHeight+"px");

            if(SignalOrientationChange != null) SignalOrientationChange();
            if(SignalResize != null) SignalResize(true);

            _didJustResize = true;
        }
    }
开发者ID:HaKDMoDz,项目名称:awayteam,代码行数:24,代码来源:FScreen.cs


示例19: PositionVideoMesh

    // Scale and position the video mesh to fill the screen
    private void PositionVideoMesh()
    {
        // Cache the screen orientation and size
        mScreenOrientation = QCARRuntimeUtilities.ScreenOrientation;
        mScreenWidth = Screen.width;
        mScreenHeight = Screen.height;

        // Reset the rotation so the mesh faces the camera
        gameObject.transform.localRotation = Quaternion.AngleAxis(270.0f, Vector3.right);

        // Adjust the rotation for the current orientation
        if (mScreenOrientation == ScreenOrientation.Landscape)
        {
            gameObject.transform.localRotation *= Quaternion.identity;
        }
        else if (mScreenOrientation == ScreenOrientation.Portrait)
        {
            gameObject.transform.localRotation *= Quaternion.AngleAxis(90.0f, Vector3.up);
        }
        else if (mScreenOrientation == ScreenOrientation.LandscapeRight)
        {
            gameObject.transform.localRotation *= Quaternion.AngleAxis(180.0f, Vector3.up);
        }
        else if (mScreenOrientation == ScreenOrientation.PortraitUpsideDown)
        {
            gameObject.transform.localRotation *= Quaternion.AngleAxis(270.0f, Vector3.up);
        }

        // Scale game object for full screen video image:
       // gameObject.transform.localScale = new Vector3(1, 1, 1 * (float)mTextureInfo.imageSize.y / (float)mTextureInfo.imageSize.x);

        // Set the scale of the orthographic camera to match the screen size:
        m_Camera.orthographic = true;

        // Visible portion of the image:
        float visibleHeight;
        if (ShouldFitWidth())
        {
            // should fit width is true, so we have to adjust the horizontal autographic size so that
            // the viewport covers the whole texture WIDTH.
            if (QCARRuntimeUtilities.IsPortraitOrientation)
            {
                // in portrait mode, the background is rotated by 90 degrees. It's actual height is
                // therefore 1, so we have to set the visible height so that the visible width results in 1.
                visibleHeight = (mTextureInfo.imageSize.y / (float)mTextureInfo.imageSize.x) *
                                ((float)mScreenHeight / (float)mScreenWidth);
            }
            else
            {
                // in landscape mode, we have to set the visible height to the screen ratio to
                // end up with a visible width of 1.
                visibleHeight = (float)mScreenHeight / (float)mScreenWidth;
            }
        }
        else
        {
            // should fit width is true, so we have to adjust the horizontal autographic size so that
            // the viewport covers the whole texture HEIGHT.
            if (QCARRuntimeUtilities.IsPortraitOrientation)
            {
                // in portrait mode, texture height is 1
                visibleHeight = 1.0f;
            }
            else
            {
                // in landscape mode, the texture height will be this value (see above)
                visibleHeight = mTextureInfo.imageSize.y / (float)mTextureInfo.imageSize.x;
            }
        }

       // m_Camera.orthographicSize = 1/visibleHeight;
    }
开发者ID:johanbissemattsson,项目名称:FIcontent.Gaming.Enabler.RealityMixer.CameraArtifactRendering,代码行数:73,代码来源:VideoTextureBehaviour.cs


示例20: GetProjectionGL

 /// <summary>
 /// Returns the QCAR projection matrix
 /// </summary>
 public static Matrix4x4 GetProjectionGL(float nearPlane, float farPlane, ScreenOrientation screenOrientation)
 {
     return QCARUnityImpl.GetProjectionGL(nearPlane, farPlane, screenOrientation);
 }
开发者ID:carrizofm2010,项目名称:app012-acuariotribuno,代码行数:7,代码来源:QCARUnity.cs



注:本文中的ScreenOrientation类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ScreenPoint类代码示例发布时间:2022-05-24
下一篇:
C# ScreenMessage类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap