Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:HorizontalScrollWindowSetOffset

From RoR Wiki
Revision as of 19:45, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · ScrollWindow functions
Version: WAR 1.4.8

Scrolls a HorizontalScrollWindow to a horizontal offset.

HorizontalScrollWindowSetOffset(scrollWindowName, offset)

Arguments

scrollWindowName
string – Name of the HorizontalScrollWindow.
offset
number – Distance in pixels from the left edge of the content to the left edge of the visible area.

Returns

Nothing.

Details

  • This is the horizontal counterpart of ScrollWindowSetOffset and behaves the same way, using widths instead of heights.
  • The offset is clamped to the range from 0 to the content width minus the window width (0 if the content is not wider than the window). The content width is the one last measured by HorizontalScrollWindowUpdateScrollRect.
  • If the clamped offset is the same as the current one, nothing happens. Otherwise the scroll child and the scroll bar, if any, are moved.
  • The stock UI never calls this function.
  • The function needs at least two arguments and only reads the last two. Any extra arguments placed in front of them are ignored.

Errors

The error messages always use the name HorizontalScrollWindowSetOffset:

  • Error in function call 'HorizontalScrollWindowSetOffset': Window %s does not exist
  • Error in function call 'HorizontalScrollWindowSetOffset': Window %s is not a HorizontalScrollWindow

Example

A minimal example built from the signature:

HorizontalScrollWindowUpdateScrollRect( "MyHScrollWindow" )
HorizontalScrollWindowSetOffset( "MyHScrollWindow", 0 )

See also