Struct Touch | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Struct Touch

    Stores the state for a single touch point.

    Namespace: Unity.Tiny.Input
    Syntax
    public struct Touch

    Fields

    deltaX

    Specifies the difference, in pixels, between the touch point's X coordinate in the current frame and the previous frame. This tells you how far the touch point has moved horizontally in the browser or application window. Positive values indicate rightward movement, and negative values leftward movement.

    Declaration
    public int deltaX
    Field Value
    Type Description
    System.Int32

    deltaY

    Specifies the difference, in pixels, between the touch point's Y coordinate in the current frame and the previous frame. This tells you how far the touch point has moved vertically in the browser or application window. Positive values indicate upward movement, and negative values downward movement.

    Declaration
    public int deltaY
    Field Value
    Type Description
    System.Int32

    fingerId

    A unique identifier for the finger used in a touch interaction.

    Declaration
    public int fingerId
    Field Value
    Type Description
    System.Int32

    phase

    Specifies the life cycle state of this touch. The TouchState enum defines the possible values

    Declaration
    public TouchState phase
    Field Value
    Type Description
    TouchState

    x

    Specifies the absolute X coordinate of the touch, in pixels on the browser or application window. A value of 0 corresponds to the leftmost edge of the window. The higher the value, the farther right the coordinate.

    Declaration
    public int x
    Field Value
    Type Description
    System.Int32

    y

    Specifies the absolute Y coordinate of the touch, in pixels on the browser or application window. A value of 0 corresponds to the bottommost edge of the window. The higher the value, the farther up the coordinate.

    Declaration
    public int y
    Field Value
    Type Description
    System.Int32
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023