Class Widgets

java.lang.Object
com.valhalla.sdk.api.methods.Widgets

public final class Widgets extends Object
Widget-tree queries over the latest immutable native snapshot.

Widget IDs are packed as groupId << 16 | childId. Population is adapter-dependent, so check the relevant client capability and handle empty results. Coordinates describe the native game surface, not Command Center desktop coordinates.

  • Method Details

    • all

      public static List<Widget> all()
      Returns all decoded widgets.
      Returns:
      every widget decoded in the latest native snapshot
    • all

      public static List<Widget> all(Filter<Widget> filter)
      Selects all widgets accepted by a filter.
      Parameters:
      filter - widget predicate
      Returns:
      matching snapshots in native enumeration order
    • get

      public static Optional<Widget> get(int packedId)
      Finds a widget by packed identifier.
      Parameters:
      packedId - groupId << 16 | childId
      Returns:
      matching widget, or empty
    • get

      public static Optional<Widget> get(int groupId, int childId)
      Finds a widget by group and child identifiers.
      Parameters:
      groupId - non-negative widget group
      childId - child identifier from 0 through 65,535
      Returns:
      matching widget, or empty for invalid input or no match
    • visible

      public static List<Widget> visible()
      Returns visible widget snapshots.
      Returns:
      all snapshots whose native visibility flag is set
    • visible

      public static List<Widget> visible(Filter<Widget> filter)
      Selects visible widgets accepted by a filter.
      Parameters:
      filter - widget predicate
      Returns:
      matching visible snapshots
    • isVisible

      public static boolean isVisible(int packedId)
      Tests a packed widget's native visibility flag.
      Parameters:
      packedId - packed widget identifier
      Returns:
      true when a matching snapshot exists and is visible
    • group

      public static List<Widget> group(int groupId)
      Selects every widget in a group.
      Parameters:
      groupId - non-negative widget group
      Returns:
      matching snapshots, or an empty list for invalid input
    • children

      public static List<Widget> children(int packedParentId)
      Selects direct child snapshots by packed parent identifier.
      Parameters:
      packedParentId - packed parent widget identifier
      Returns:
      matching children in native enumeration order
    • first

      public static Optional<Widget> first(Filter<Widget> filter)
      Finds the first native-enumerated widget accepted by a filter.
      Parameters:
      filter - widget predicate
      Returns:
      first matching snapshot, or empty
    • withText

      public static List<Widget> withText(String text)
      Selects widgets whose text contains a fragment, ignoring case.
      Parameters:
      text - text fragment
      Returns:
      matching snapshots, or an empty list for null
    • exactText

      public static Optional<Widget> exactText(String text)
      Finds the first widget whose full text equals a value, ignoring case.
      Parameters:
      text - exact widget text
      Returns:
      first matching snapshot, or empty
    • at

      public static Optional<Widget> at(int pointX, int pointY)
      Finds the topmost visible widget containing a native-surface point.

      Reverse enumeration is used as the snapshot's z-order approximation.

      Parameters:
      pointX - native-surface X coordinate
      pointY - native-surface Y coordinate
      Returns:
      containing widget, or empty
    • count

      public static int count(Filter<Widget> filter)
      Counts widgets accepted by a filter.
      Parameters:
      filter - widget predicate
      Returns:
      number of matching snapshots