应用视图App views

Windows 应用可以包含两种类型的视图: 沉浸式视图2d 视图Windows apps can contain two kinds of views: immersive views and 2D views. 应用可以在其各种沉浸和2D 视图之间切换,并将其2D 视图显示在监视器上作为一个窗口,或显示为一个石板。Apps can switch between their various immersive and 2D views, showing their 2D views either on a monitor as a window or in a headset as a slate. 至少具有一个沉浸式视图的应用会分类为 混合现实应用Apps that have at least one immersive view are categorized as mixed reality apps. 没有沉浸式视图的应用就是 2D 应用。Apps that never have an immersive view are 2D apps.

沉浸式视图Immersive views

借助沉浸式视图,你的应用可以创建你周围世界的全息影像,或让用户沉浸在虚拟环境中。An immersive view gives your app the ability to create holograms in the world around you or immerse the user in a virtual environment. 当应用程序在沉浸式视图中绘制时,不会同时绘制 — 多个应用程序中的全息影像。When an app is drawing in the immersive view, no other app is drawing at the same time—holograms from multiple apps aren't composited together. 通过持续调整 应用程序呈现 其场景的视角来匹配用户的头运动,你的应用可以呈现 全球锁定 的全息影像。By continually adjusting the perspective from which your app renders its scene to match the user's head movements, your app can render world-locked holograms. 全球锁定的全息影像停留在现实世界中的一个固定点,或者可以呈现一个虚拟世界,在用户移动时保存其位置。World-locked holograms stay at a fixed point in the real world or can render a virtual world that holds its position as a user moves.

在沉浸式视图中,可以在世界各地放置全息影像。When in an immersive view, holograms can be placed in the world around you.
在沉浸式视图中,可以在世界各地放置全息影像When in an immersive view, holograms can be placed in the world around you

HoloLens上,你的应用程序会在用户的真实环境上呈现其全息影像。On HoloLens, your app renders its holograms on top of the user's real-world surroundings. Windows Mixed Reality 沉浸式耳机上,用户看不到现实世界,因此你的应用程序必须呈现用户将看到的所有内容。On a Windows Mixed Reality immersive headset, the user can't see the real world, and so your app must render everything the user will see.

Windows Mixed Reality home (包括在环境中放置的 "开始" 菜单和全息影像) 在沉浸式视图中也不会呈现。The Windows Mixed Reality home (including the Start menu and holograms you've placed around the environment) doesn't render while in an immersive view either. 在 HoloLens 上,Cortana 会在显示沉浸式视图时中继发生的任何系统通知,用户可以使用语音输入来做出响应。On HoloLens, Cortana relays any system notifications that occur while an immersive view is showing, to which the user can respond with voice input.

在沉浸式视图中,应用还负责处理所有输入。While in an immersive view, your app is also responsible for handling all input. Windows Mixed Reality 中的输入是由 注视手势 (HoloLens 仅) 、[语音和 运动控制器 (沉浸式耳机仅) 。Input in Windows Mixed Reality is made up of gaze, gesture (HoloLens only), [voice, and motion controllers (immersive headsets only).

2D 视图2D views

围绕 Windows Mixed Reality 主页布局的多个2D 视图Multiple 2D views laid out around the Windows Mixed Reality home
围绕 Windows Mixed Reality 主页放置了2D 视图的多个应用Multiple apps with a 2D view placed around the Windows Mixed Reality home

带有2D 视图的应用程序将出现在 Windows Mixed Reality home (中,有时称为 "shell" ) 作为虚拟石板,并与应用程序启动器以及用户在其世界中放置的其他全息影像一起呈现。An app with a 2D view appears in the Windows Mixed Reality home (sometimes called the "shell") as a virtual slate, rendered alongside the app launchers and other holograms the user has placed in their world. 用户可以调整此石板,使其移动和缩放,但其大小仍保持固定分辨率。The user can adjust this slate to move and scale it, though it remains at a fixed resolution whatever its size. 如果您的应用程序的第一个视图是2D 视图,则您的2D 内容将填充用于启动该应用程序的同一个石板。If your app's first view is a 2D view, your 2D content will fill the same slate used to launch the app.

在台式机耳机上,你可以在现在的桌面监视器上运行通用 Windows 平台 (UWP) 应用。In a desktop headset, you can run any Universal Windows Platform (UWP) apps that run on your desktop monitor today. 这些应用现在已经呈现了2D 视图,并且其内容将在启动时自动显示在用户世界的某个石板上。These apps are already rendering 2D views today, and their content will automatically appear on a slate in the user's world when launched. 2D UWP 应用可以面向 Windows 通用 设备家族,使其在桌面耳机和 HoloLens 上都以清单的形式运行。2D UWP apps can target the Windows.Universal device family to run on both desktop headsets and on HoloLens as slates.

2D 视图的一项关键用途是显示使用系统键盘的文本输入窗体。One key use of 2D views is showing a text entry form that uses the system keyboard. 由于 shell 无法在沉浸式视图顶部呈现,因此应用程序必须切换到2D 视图以显示系统键盘。Because the shell can't render on top of an immersive view, the app has to switch to a 2D view to show the system keyboard. 需要接受文本输入的应用需要切换到带有文本框的2D 视图。Apps that want to accept text input need to switch to a 2D view with a text box. 当该文本框有焦点时,系统将显示系统键盘,允许用户输入文本。While that text box has focus, the system will show the system keyboard, allowing the user to enter text.

应用可在桌面显示器和台式计算机上的已连接耳机上具有2D 视图。An app can have 2D views on both the desktop monitor and in an attached headset on a desktop PC. 例如,你可以使用其主2D 视图在桌面监视器上浏览边缘,以查找360度视频。For example, you can browse Edge on your desktop monitor using its main 2D view to find a 360-degree video. 播放视频后,边缘将在耳机内启动辅助沉浸式视图以显示沉浸式视频内容。When you play that video, Edge will launch a secondary immersive view inside the headset to display the immersive video content.

另请参阅See also