Updated tutorial_viewports (markdown)

reduz 2014-04-18 14:13:53 -07:00
parent 38e9b531dd
commit a36f59878b

@ -56,7 +56,9 @@ The root viewport uses this for the stretch options in the project settings.
For 3D, a Viewport will contain a [World](class_world). This is basically, the universe that links physics and rendering together. Spatial-base nodes will register using the World of the closest viewport. By default, newly created viewports do not contain a World but use the same as a parent viewport (root viewport does contain one though, which is the one objects are renderer by default). A world can be set in a viewport using the "world" property, and that will separate all children nodes of that viewport from interacting with the parent viewport world. This is specially useful in scenarios where, for example, you might want to show a separate character in 3D imposed over the game (like in Starcraft).
For 2D, each Viewport contains it's own [World2D](class_world2d). This suffices in most cases, but in case sharing them may be desired, it is possible to do so by calling the viewport API manually.
As a helper for situations where you want to create viewports that display single objects and don't want to create a world, viewport has the option to use it's own World. This is very useful when you want to instance 3D characters or objects in the 2D world.
For 2D, each Viewport always contains it's own [World2D](class_world2d). This suffices in most cases, but in case sharing them may be desired, it is possible to do so by calling the viewport API manually.
### Capture
@ -93,8 +95,10 @@ sprite.set_texture(rtt)
By default, re-rendering of the render target happens when the render target texture has been drawn in a frame. If visible, it will be rendered, otherwise it will not. This behavior can be changed to manual rendering (once), or always render, no matter if visible or not.
A few classes are created to make this easier in most common cases inside the editor:
* [ViewportSprite](class_viewportsprite) (for 2D).
* [ViewportQuad](class_viewportquad) (for 3D).
* [ViewportFrame](class_viewportframe) (for GUI).
Make sure to check the viewport demos! (viewport folder in the demo.zip available to download, or [here](https://github.com/okamstudio/godot/tree/master/demos/viewport).