class
GUIViewport
Displays a Camera view in the form of a GUI element.
Public
Methods
staticGetGuiTypeName
Returns type name of the GUI element used for finding GUI element styles.
staticCreate
Creates a new GUI viewport element.
- camera
- Camera whos view to display in the element. Element will update the camera as it resizes.
- aspectRatio
- Initial aspect of the camera. Determines how is FOV adjusted as the element resizes.
- fieldOfView
- Initial FOV of the camera. Determines how is FOV adjusted as the element resizes.
- styleName
- Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on. If not specified default style is used.
staticCreate
Creates a new GUI viewport element.
- camera
- Camera whos view to display in the element. Element will update the camera as it resizes.
- aspectRatio
- Initial aspect of the camera. Determines how is FOV adjusted as the element resizes.
- fieldOfView
- Initial FOV of the camera. Determines how is FOV adjusted as the element resizes.
- options
- Options that allow you to control how is the element positioned and sized. This will override any similar options set by style.
- styleName
- Optional style to use for the element. Style will be retrieved from GUISkin of the GUIWidget the element is used on. If not specified default style is used.
Internal
Methods
CalculateUnconstrainedOptimalSize
Calculates the optimal size for the GUI element, ignoring size constraints.
Protected
Methods
~GUIViewport
FillBuffer
Fill the pre-allocated vertex, uv and index buffers with the mesh data for the specified render element.
- vertices
- Previously allocated buffer where to store the vertices. Output is expected to match the GUIMeshType as returned by getRenderElements() for the specified element.
- indices
- Previously allocated buffer where to store the indices.
- vertexOffset
- At which vertex should the method start filling the buffer.
- offset
- Offset that should be applied to all output vertex positions.
- indexOffset
- At which index should the method start filling the buffer.
- maxVertexCount
- Total number of vertices the buffers were allocated for. Used only for memory safety.
- maxIndexCount
- Total number of indices the buffers were allocated for. Used only for memory safety.
- renderElementIdx
- Zero-based index of the render element.
UpdateRenderElements
Recreates the internal render elements.
Must be called before GetRenderElementVertexAndIndexData/FillBuffer if element is dirty. Marks the element as non dirty.
Private
Constructors
GUIViewport
Methods
ChangeParentWidget
Changes the active GUI element widget.
This allows you to move an element to a different viewport, or change element style by using a widget with a different skin. You are allowed to pass null here, but elements with no parent will be unmanaged. You will be responsible for deleting them manually, and they will not render anywhere.