NetPad
  • General
    • Introduction
    • Technical Overview
  • Manual
    • Terminology
      • Server (Game), Client (Controller)
      • Controller - Input, Proxy
      • Constants
      • Webserver
    • Components
      • NetPadServer
      • NetPadClient
      • NetPadBehaviour
      • Input
        • NetPadJoystick
        • NetPadGyroscope
        • NetPadDPad
          • DPadButton
        • NetPadAccelerometer
        • NetPadTouch
        • NetPadCamera
        • NetPadButton
      • LayoutListener
      • NetPadDiscoveryServer
      • NetPadDiscoveryClient
    • Other
      • Attributes
      • Build Pipeline
      • NetPad Settings
      • NetPad Constants
    • Tutorials
      • Getting Started
        • Project Setup
        • Game Setup
          • Preperation
          • Ball
          • Ball Spawner
          • Scene Setup
        • Controller Setup
          • Background - Player Properties
          • Scene Setup
        • Build
Powered by GitBook
On this page
  1. Manual
  2. Components
  3. Input

NetPadCamera

The NetPadCamera class is a networked controller component that captures and synchronizes camera data between a client device and a server. It inherits from NetPadClientController and uses CameraMessage for data transfer.

  • CameraOrientation: Enum to select either the front or back camera.

  • Resolution: A Vector2Int representing the desired camera resolution.

  • Quality: An integer value representing the image quality (0 to 100).

  • TextureFormat: The format of the texture used for the camera image.

  • Start(): Initializes the camera, sets the background texture, and starts the camera.

  • IsSupported(): Checks if the device supports camera functionality.

  • FindCameraDevice(): Searches for and initializes the appropriate camera device based on the specified CameraOrientation.

  • HasChanged(): Determines if the camera data has changed.

  • TakeSnapshot(): Captures a snapshot from the camera, encodes it to JPEG format, and sets the m_hasChanged flag.

  • UpdateData(CameraMessage message): Updates the CameraMessage with the latest camera data.

NetPadCamera efficiently utilizes network resources and ensures accurate synchronization of device camera information in networked games or applications. The class also provides methods to initialize the camera and take snapshots.

PreviousNetPadTouchNextNetPadButton

Last updated 2 years ago