Viewport2D
¶
Use a Viewport 2D to set the size of a render target surface onto which content is projected. Viewport 2D is a 2D node that can project a 3D scene through a camera. Viewport 2D is a special node because it can render both 2D nodes, such as Image, Page, Button 2D, and a Scene, which is a 3D node.
When you create a new project in Kanzi Studio, that project has a Viewport 2D with a Scene that contains a Camera and a Directional Light. However, when you create a Viewport 2D using the API you have to manually add the Scene and any contents of the Scene.
Inherits properties and message types from Viewport2DMetadata.
| create() | Creates a Viewport2D node |
| create1() | Creates a Viewport2D node |
| createDefault() | Creates a Viewport2D node |
| createDefault1() | Creates a Viewport2D node |
Creates a Viewport2D node.
The viewport is created without a scene.
| name | (string) | Node name. |
Creates a Viewport2D node.
The viewport is created without a scene.
| name | (string) | Node name. |
| width | (number) | Node width. |
| height | (number) | Node height. |
Creates a Viewport2D node.
A scene is created at the same time.
| name | (string) | Node name. |
Creates a Viewport2D node.
A scene is created at the same time.
| name | (string) | Node name. |
| width | (number) | Node width. |
| height | (number) | Node height. |