MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / scroll

Method scroll

unity_cli/api/uitree.py:143–177  ·  view source on GitHub ↗

Scroll a ScrollView element. Args: ref: Element reference ID (e.g., "ref_5"). panel: Panel name (used with name). name: Element name (used with panel). x: Absolute scroll offset X. y: Absolute scroll offset Y. to_child:

(
        self,
        ref: str | None = None,
        panel: str | None = None,
        name: str | None = None,
        x: float | None = None,
        y: float | None = None,
        to_child: str | None = None,
    )

Source from the content-addressed store, hash-verified

141 return self._conn.send_request("uitree", params)
142
143 def scroll(
144 self,
145 ref: str | None = None,
146 panel: str | None = None,
147 name: str | None = None,
148 x: float | None = None,
149 y: float | None = None,
150 to_child: str | None = None,
151 ) -> dict[str, Any]:
152 """Scroll a ScrollView element.
153
154 Args:
155 ref: Element reference ID (e.g., "ref_5").
156 panel: Panel name (used with name).
157 name: Element name (used with panel).
158 x: Absolute scroll offset X.
159 y: Absolute scroll offset Y.
160 to_child: Ref ID of child element to scroll into view.
161
162 Returns:
163 Dictionary containing scroll result with scrollOffset.
164 """
165 params: dict[str, Any] = {"action": "scroll"}
166 if ref:
167 params["ref"] = ref
168 self._add_panel_param(params, panel)
169 if name:
170 params["name"] = name
171 if x is not None:
172 params["x"] = x
173 if y is not None:
174 params["y"] = y
175 if to_child:
176 params["to_child"] = to_child
177 return self._conn.send_request("uitree", params)
178
179 def text(
180 self,

Calls 2

_add_panel_paramMethod · 0.95
send_requestMethod · 0.80