ScrollView component

Hierarchy (view full)

Constructors

Properties

_debugDrawEnabled: boolean = false
_enableScrollInertia: boolean = true
_scrollLimit: number = 0.3
api: Record<string, any>
enabled: boolean

If disabled, the Component will stop enacting its behavior.

enableHorizontalScroll: boolean = false
enableScrollLimit: boolean = true
enableVerticalScroll: boolean = true
name: string
sceneObject: SceneObject
scrollAreaBounds: vec2 = ...
transform: Transform
uniqueIdentifier: string
updatePriority: number

Accessors

  • get contentLength(): number
  • Returns number

    the length of the content along the y-axis in local units relative to the ScrollView canvas.

  • set contentLength(length): void
  • Parameters

    • length: number

      the length of the content along the y-axis in local units relative to the ScrollView canvas.

    Returns void

  • get contentOffset(): Rect
  • Returns Rect

    the offset to each content edge and the ScrollArea in world units relative to the canvas' rotation.

  • get contentPosition(): vec3
  • Returns vec3

  • set contentPosition(position): void
  • Parameters

    Returns void

  • get debugDrawEnabled(): boolean
  • Returns boolean

  • set debugDrawEnabled(debugDrawEnabled): void
  • Parameters

    • debugDrawEnabled: boolean

    Returns void

  • get enableScrollInertia(): boolean
  • Returns boolean

  • set enableScrollInertia(enableScrollInertia): void
  • Parameters

    • enableScrollInertia: boolean

    Returns void

  • get overflow(): number
  • Returns number

    the amount of content overflow along the y-axis in local units relative to the ScrollView's canvas.

  • get scrollAreaSize(): vec2
  • Returns vec2

    the ScrollArea's size in local units relative to the ScrollView canvas.

  • get scrollColliderBounds(): vec2
  • Returns vec2

    the ScrollArea collider's BoxShape's bounds.

  • set scrollColliderBounds(bounds): void
  • Parameters

    • bounds: vec2

      the ScrollArea collider's BoxShape's bounds.

    Returns void

  • get scrollLimit(): number
  • Returns number

  • set scrollLimit(limit): void
  • Parameters

    • limit: number

    Returns void

  • get scrollPercentage(): number
  • Returns number

    the scroll percentage of the ScrollView (0=top of ScrollView, 1= bottom).

Methods

  • Checks if both inputted content edges are fully visible in the ScrollArea.

    Parameters

    • xEdge: -1 | 0 | 1

      0 if not checking any x-axis edge, 1 for right edge, -1 for left edge.

    • yEdge: -1 | 0 | 1

      0 if not checking any y-axis edge, 1 for top edge, -1 for bottom edge.

    Returns boolean

  • Returns true if the object matches or derives from the passed in type.

    Parameters

    • type: string

    Returns boolean

  • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

    Parameters

    Returns boolean

  • Returns void

  • Returns void

  • Resets the content origin for the purpose of calculating scrollPercentage. Assumes that the ScrollView is currently at the top of content in the pooling use case.

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void