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

NetPadTouch

The NetPadTouch class is a networked controller component that captures and synchronizes touch input between a client device and a server. It inherits from NetPadClientController and uses TouchMessage for data transfer.

TouchArea: A RectTransform defining the area in which touch input will be recognized and synced to the server/game.

  • IsSupported(): Checks if the device supports touch input.

  • UpdateData(TouchMessage message): Updates the TouchMessage with the latest touch input.

  • HasChanged(): Always returns true, indicating that touch input is considered changed.

  • OnUpdate(): Called during the update cycle if the client is connected and touch input has changed.

  • OnTick(): Called during the tick cycle if any touch position has changed.

NetPadTouch efficiently utilizes network resources and ensures accurate synchronization of device touch information in networked games or applications. The class also provides helper methods to validate touch capacity, detect touch phase changes, and retrieve previous touch data for a given finger ID.

PreviousNetPadAccelerometerNextNetPadCamera

Last updated 2 years ago