### Navigation

- index
- next |
- previous |
- The Pygame SGE 0.5.0 documentation »
- Classes »

# sge.View

class `sge.``View`(x, y, xport=0, yport=0, width=None, height=None)

  Class for room views.

  This class controls what the player sees in a room at any given time. Multiple views can exist in a room, and this can be used to create a split-screen effect.

  `x`

    The horizontal position of the view in the room. When set, if it brings the view outside of the room it is in, it will be re-adjusted so that the view is completely inside the room.

  `y`

    The vertical position of the view in the room. When set, if it brings the view outside of the room it is in, it will be re-adjusted so that the view is completely inside the room.

  `xport`

    The horizontal position of the view port on the screen.

  `yport`

    The vertical position of the view port on the screen.

  `width`

    The width of the view. When set, if it results in the view being outside of the room it is in, `x` will be adjusted so that the view is completely inside the room.

  `height`

    The height of the view. When set, if it results in the view being outside the room it is in, `y` will be adjusted so that the view is completely inside the room.

## sge.View Methods

`View.``__init__`(x, y, xport=0, yport=0, width=None, height=None)

  Constructor method.

  Arguments:

  - `width` – The width of the view. If set to `None`, it will be set such that the view port takes up all of the space that it can horizontally (i.e. `sge.game.width - xport`).
  - `height` – The height of the view. If set to `None`, it will be set such that the view port takes up all of the space that it can vertically (i.e. `sge.game.height - yport`).

  All other arugments set the respective initial attributes of the view. See the documentation for `sge.View` for more information.

### Navigation

- index
- next |
- previous |
- The Pygame SGE 0.5.0 documentation »
- Classes »