Viewport

    Abstract base class for viewports. Encapsulates drawing and interaction with a game world.

    Viewport.swift:26
    class Viewport

    A Viewport creates a different view into the screen, or a sub-view inside another viewport. Children 2D Nodes will display on it, and children Camera3D 3D nodes will render on it too.

    Optionally, a viewport can have its own 2D or 3D world, so it doesn’t share what it draws with other viewports.

    Viewports can also choose to be audio listeners, so they generate positional audio depending on a 2D or 3D camera child of it.

    Also, viewports can be assigned to different screens in case the devices have multiple screens.

    Finally, viewports can also behave as render targets, in which case they will not be visible unless the associated texture is used to draw.

    This object emits the following signals:

    Superclasses

    Citizens in SwiftGodot

    Conformances

    • protocol CustomStringConvertible

      A type with a customized textual representation.

    • protocol Equatable

      A type that can be compared for value equality.

    • protocol Hashable

      A type that can be hashed into a Hasher to produce an integer hash value.

    • protocol Identifiable<ID>

      A class of types whose instances hold the value of an entity with stable identity.

    • protocol VariantRepresentable

      Types that conform to VariantRepresentable can be stored directly in Variant with no conversion. These include all of the Variant types from Godot (for example GString, Rect, Plane), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.

    • protocol VariantStorable

      Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.

    Types

    Type members

    Instance members

    Subclasses

    • class SubViewport

      An interface to a game world that doesn’t create a window or draw to the screen directly.

    • class Window

      Base class for all windows, dialogs, and popups.